Browse Source

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 56e76bd057)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
tags/n3.3.8
Michael Niedermayer 7 years ago
parent
commit
aa50d67cc7
1 changed files with 3 additions and 0 deletions
  1. +3
    -0
      libavformat/mov.c

+ 3
- 0
libavformat/mov.c View File

@@ -3516,6 +3516,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…
Cancel
Save