diff options
author | Michael Niedermayer <[email protected]> | 2021-03-24 17:03:08 +0100 |
---|---|---|
committer | Michael Niedermayer <[email protected]> | 2021-10-17 21:34:53 +0200 |
commit | 718c64f03be0b2039370d4615afa64a358acdeef (patch) | |
tree | 1e441483d0c6847f71534cad5a8a2c83c59b7f8c | |
parent | 59ec9f802fa0eb447b2928134a779634c8891aed (diff) |
avformat/mov: Ignore multiple STSC / STCO
Fixes: STSC / STCO inconsistency and assertion failure
Fixes: crbug1184666.mp4
Found-by: Chromium ASAN fuzzer
Reviewed-by: Matt Wolenetz <[email protected]>
Signed-off-by: Michael Niedermayer <[email protected]>
(cherry picked from commit 2611d20d353026f996cb9aaced8b35db37f490d4)
Signed-off-by: Michael Niedermayer <[email protected]>
-rw-r--r-- | libavformat/mov.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c index 04af735591..52359b0555 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -1591,8 +1591,10 @@ static int mov_read_stco(MOVContext *c, AVIOContext *pb, MOVAtom atom) if (!entries) return 0; - if (sc->chunk_offsets) - av_log(c->fc, AV_LOG_WARNING, "Duplicated STCO atom\n"); + if (sc->chunk_offsets) { + av_log(c->fc, AV_LOG_WARNING, "Ignoring duplicated STCO atom\n"); + return 0; + } av_free(sc->chunk_offsets); sc->chunk_count = 0; sc->chunk_offsets = av_malloc_array(entries, sizeof(*sc->chunk_offsets)); @@ -2217,8 +2219,10 @@ static int mov_read_stsc(MOVContext *c, AVIOContext *pb, MOVAtom atom) if (!entries) return 0; - if (sc->stsc_data) - av_log(c->fc, AV_LOG_WARNING, "Duplicated STSC atom\n"); + if (sc->stsc_data) { + av_log(c->fc, AV_LOG_WARNING, "Ignoring duplicated STSC atom\n"); + return 0; + } av_free(sc->stsc_data); sc->stsc_count = 0; sc->stsc_data = av_malloc_array(entries, sizeof(*sc->stsc_data)); |