[FFmpeg-cvslog] error_concealment: Check that the picture is not in a half setup state.

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


ffmpeg | branch: release/1.0 | Michael Niedermayer <michaelni at gmx.at> | Fri Jan 11 04:44:20 2013 +0100| [3e196e4def03c7a91423803402f84d638d316c33] | committer: Michael Niedermayer

error_concealment: Check that the picture is not in a half setup state.

Fixes state becoming inconsistent
Fixes a null pointer dereference

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

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

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

 libavcodec/error_resilience.c |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/libavcodec/error_resilience.c b/libavcodec/error_resilience.c
index 6ae06f2..a166256 100644
--- a/libavcodec/error_resilience.c
+++ b/libavcodec/error_resilience.c
@@ -923,6 +923,12 @@ void ff_er_frame_end(MpegEncContext *s)
         return;
     };
 
+    if (   s->picture_structure == PICT_FRAME
+        && s->current_picture.f.linesize[0] != s->current_picture_ptr->f.linesize[0]) {
+        av_log(s->avctx, AV_LOG_ERROR, "Error concealment not possible, frame not fully initialized\n");
+        return;
+    }
+
     if (s->current_picture.f.motion_val[0] == NULL) {
         av_log(s->avctx, AV_LOG_ERROR, "Warning MVs not available\n");
 



More information about the ffmpeg-cvslog mailing list