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 <wolenetz@google.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 2611d20d353026f996cb9aaced8b35db37f490d4) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
c0c53ad2de
commit
7aceba2349
@ -2011,8 +2011,10 @@ static int mov_read_stco(MOVContext *c, AVIOContext *pb, MOVAtom atom)
|
|||||||
if (!entries)
|
if (!entries)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (sc->chunk_offsets)
|
if (sc->chunk_offsets) {
|
||||||
av_log(c->fc, AV_LOG_WARNING, "Duplicated STCO atom\n");
|
av_log(c->fc, AV_LOG_WARNING, "Ignoring duplicated STCO atom\n");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
av_free(sc->chunk_offsets);
|
av_free(sc->chunk_offsets);
|
||||||
sc->chunk_count = 0;
|
sc->chunk_count = 0;
|
||||||
sc->chunk_offsets = av_malloc_array(entries, sizeof(*sc->chunk_offsets));
|
sc->chunk_offsets = av_malloc_array(entries, sizeof(*sc->chunk_offsets));
|
||||||
@ -2655,8 +2657,10 @@ static int mov_read_stsc(MOVContext *c, AVIOContext *pb, MOVAtom atom)
|
|||||||
|
|
||||||
if (!entries)
|
if (!entries)
|
||||||
return 0;
|
return 0;
|
||||||
if (sc->stsc_data)
|
if (sc->stsc_data) {
|
||||||
av_log(c->fc, AV_LOG_WARNING, "Duplicated STSC atom\n");
|
av_log(c->fc, AV_LOG_WARNING, "Ignoring duplicated STSC atom\n");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
av_free(sc->stsc_data);
|
av_free(sc->stsc_data);
|
||||||
sc->stsc_count = 0;
|
sc->stsc_count = 0;
|
||||||
sc->stsc_data = av_malloc_array(entries, sizeof(*sc->stsc_data));
|
sc->stsc_data = av_malloc_array(entries, sizeof(*sc->stsc_data));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user