Commit 1d01a3b3 authored by Michael Niedermayer's avatar Michael Niedermayer

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: 's avatarMichael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 56e76bd0)
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 2742cb10
......@@ -3899,6 +3899,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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment