h264: Only apply error concealment if theres a frame
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 20 Jan 2013 14:03:13 +0000 (15:03 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Thu, 7 Feb 2013 00:00:02 +0000 (01:00 +0100)
Without any correctly decoded slices, there can be no frame.

Fixes out of array reads

Found-by: Rafaël Carré
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 60af6c3138dc501a647bc69b374d5d33d5d86ab5)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/h264.c

index e28cc63..cd7dc5a 100644 (file)
@@ -2280,7 +2280,7 @@ static int field_end(H264Context *h, int in_setup)
      * past end by one (callers fault) and resync_mb_y != 0
      * causes problems for the first MB line, too.
      */
-    if (!FIELD_PICTURE)
+    if (!FIELD_PICTURE && h->current_slice)
         ff_er_frame_end(s);
 
     ff_MPV_frame_end(s);