h264: skip error concealment when SPS and slices are mismatching
authorMichael Niedermayer <michaelni@gmx.at>
Sat, 2 Feb 2013 20:11:54 +0000 (21:11 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 5 Feb 2013 15:53:12 +0000 (16:53 +0100)
Fixes out of array accesses

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 695af8eed642ff0104834495652d1ee784a4c14d)

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

index da144db..0aab4e7 100644 (file)
@@ -2351,7 +2351,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 && h->current_slice)
+    if (!FIELD_PICTURE && h->current_slice && !h->sps.new)
         ff_er_frame_end(s);
 
     ff_MPV_frame_end(s);