[FFmpeg-devel,2/2] avformat/mov: Only fail for STCO/STSC contradictions if both exist

Submitted by Michael Niedermayer on May 15, 2018, 3:07 p.m.

Details

Message ID 20180515150700.4638-2-michael@niedermayer.cc
State Accepted
Commit 2c2d689c56646cce64d02a3b75f61c12c5589260
Headers show

Commit Message

Michael Niedermayer May 15, 2018, 3:07 p.m.
Fixes regression with playback of GF9720Repeal20the20Eighth20with20Helen20Linehan.m4a
See: crbug 822666

Found-by: "Mattias Wadman <mattias.wadman@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavformat/mov.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Carl Eugen Hoyos May 15, 2018, 4:53 p.m.
2018-05-15 17:07 GMT+02:00, Michael Niedermayer <michael@niedermayer.cc>:
> Fixes regression with playback of
> GF9720Repeal20the20Eighth20with20Helen20Linehan.m4a
> See: crbug 822666

Please mention ticket #7165 if related.

Thank you, Carl Eugen
Michael Niedermayer May 21, 2018, 12:32 a.m.
On Tue, May 15, 2018 at 06:53:49PM +0200, Carl Eugen Hoyos wrote:
> 2018-05-15 17:07 GMT+02:00, Michael Niedermayer <michael@niedermayer.cc>:
> > Fixes regression with playback of
> > GF9720Repeal20the20Eighth20with20Helen20Linehan.m4a
> > See: crbug 822666
> 
> Please mention ticket #7165 if related.

its unrelated, ill post a patch fixing this if it passes tests

will apply this patchset

thx

[...]

Patch hide | download patch | download mbox

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 4848a106f2..a078bf4712 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -4148,7 +4148,7 @@  static int mov_read_trak(MOVContext *c, AVIOContext *pb, MOVAtom atom)
                st->index);
         return 0;
     }
-    if (sc->stsc_count && sc->stsc_data[ sc->stsc_count - 1 ].first > sc->chunk_count) {
+    if (sc->chunk_count && sc->stsc_count && sc->stsc_data[ sc->stsc_count - 1 ].first > sc->chunk_count) {
         av_log(c->fc, AV_LOG_ERROR, "stream %d, contradictionary STSC and STCO\n",
                st->index);
         return AVERROR_INVALIDDATA;