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> (cherry picked from commit 56e76bd0579cc7f7b28860885d9e569a39daf41b) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
fe9c23bebb
commit
b4024909c1
@ -2829,6 +2829,9 @@ static void mov_build_index(MOVContext *mov, AVStream *st)
|
||||
} else {
|
||||
unsigned chunk_samples, total = 0;
|
||||
|
||||
if (!sc->chunk_count)
|
||||
return;
|
||||
|
||||
// compute total chunk count
|
||||
for (i = 0; i < sc->stsc_count; i++) {
|
||||
unsigned count, chunk_count;
|
||||
|
Loading…
x
Reference in New Issue
Block a user