mov: Fix harmless OOB read.
authorDale Curtis <dalecurtis@chromium.org>
Fri, 13 Apr 2012 01:02:33 +0000 (18:02 -0700)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 13 Apr 2012 09:28:32 +0000 (11:28 +0200)
Convert key_off initialize to use the same sc->keyframe_count as
used elsewhere in the function.

Signed-off-by: Dale Curtis <dalecurtis@chromium.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/mov.c

index b4ff1df..ce61250 100644 (file)
@@ -1842,7 +1842,7 @@ static void mov_build_index(MOVContext *mov, AVStream *st)
         unsigned int stts_sample = 0;
         unsigned int sample_size;
         unsigned int distance = 0;
-        int key_off = sc->keyframes && sc->keyframes[0] == 1;
+        int key_off = sc->keyframe_count && sc->keyframes[0] == 1;
 
         current_dts -= sc->dts_shift;