mirror of https://git.ffmpeg.org/ffmpeg.git
avformat/mov: Break out early if chunk_count is 0 in mov_build_index()
Without this some operations might overflow (undefined behavior) even though the index adding loop would never execute No testcase known Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
fac5849915
commit
56e76bd057
|
@ -3900,6 +3900,9 @@ static void mov_build_index(MOVContext *mov, AVStream *st)
|
||||||
} else {
|
} else {
|
||||||
unsigned chunk_samples, total = 0;
|
unsigned chunk_samples, total = 0;
|
||||||
|
|
||||||
|
if (!sc->chunk_count)
|
||||||
|
return;
|
||||||
|
|
||||||
// compute total chunk count
|
// compute total chunk count
|
||||||
for (i = 0; i < sc->stsc_count; i++) {
|
for (i = 0; i < sc->stsc_count; i++) {
|
||||||
unsigned count, chunk_count;
|
unsigned count, chunk_count;
|
||||||
|
|
Loading…
Reference in New Issue