[FFmpeg-cvslog] h264: Only apply error concealment if theres a frame

Michael Niedermayer git at videolan.org
Thu Feb 7 01:22:22 CET 2013


ffmpeg | branch: release/1.0 | Michael Niedermayer <michaelni at gmx.at> | Sun Jan 20 15:03:13 2013 +0100| [3f2715804019a963bdd4e7fe7aafbd5e72aba0f5] | committer: Michael Niedermayer

h264: Only apply error concealment if theres a frame

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 at gmx.at>
(cherry picked from commit 60af6c3138dc501a647bc69b374d5d33d5d86ab5)

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3f2715804019a963bdd4e7fe7aafbd5e72aba0f5
---

 libavcodec/h264.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index e28cc63..cd7dc5a 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -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);



More information about the ffmpeg-cvslog mailing list