[FFmpeg-devel] [PATCH] fix H.264 crash (issue 706)

Reimar Döffinger Reimar.Doeffinger
Thu Apr 9 12:17:43 CEST 2009


Hello,
it is quite possible this just hides the real issue, but on the other hand it
looks like a simple and not too ugly fix to me.
Comments?
-------------- next part --------------
Index: libavcodec/mpegvideo.c
===================================================================
--- libavcodec/mpegvideo.c	(revision 18382)
+++ libavcodec/mpegvideo.c	(working copy)
@@ -1886,12 +1889,12 @@
                     }else{
                         op_pix = s->dsp.put_no_rnd_pixels_tab;
                     }
-                    if (s->mv_dir & MV_DIR_FORWARD) {
+                    if ((s->mv_dir & MV_DIR_FORWARD) && s->last_picture.data[0]) {
                         MPV_motion(s, dest_y, dest_cb, dest_cr, 0, s->last_picture.data, op_pix, op_qpix);
                         op_pix = s->dsp.avg_pixels_tab;
                         op_qpix= s->me.qpel_avg;
                     }
-                    if (s->mv_dir & MV_DIR_BACKWARD) {
+                    if ((s->mv_dir & MV_DIR_BACKWARD) && s->next_picture.data[0]) {
                         MPV_motion(s, dest_y, dest_cb, dest_cr, 1, s->next_picture.data, op_pix, op_qpix);
                     }
                 }



More information about the ffmpeg-devel mailing list