[FFmpeg-cvslog] r26397 - trunk/libavcodec/4xm.c

michael subversion
Sun Jan 16 23:08:34 CET 2011


Author: michael
Date: Sun Jan 16 23:08:34 2011
New Revision: 26397

Log:
Allocate last picture for 4xm pfrm if its not allocated.
Fixes segfault and issue2527

Modified:
   trunk/libavcodec/4xm.c

Modified: trunk/libavcodec/4xm.c
==============================================================================
--- trunk/libavcodec/4xm.c	Sun Jan 16 21:16:01 2011	(r26396)
+++ trunk/libavcodec/4xm.c	Sun Jan 16 23:08:34 2011	(r26397)
@@ -791,6 +791,14 @@ static int decode_frame(AVCodecContext *
         if(decode_i_frame(f, buf, frame_size) < 0)
             return -1;
     }else if(frame_4cc == AV_RL32("pfrm") || frame_4cc == AV_RL32("pfr2")){
+        if(!f->last_picture.data[0]){
+            f->last_picture.reference= 1;
+            if(avctx->get_buffer(avctx, &f->last_picture) < 0){
+                av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+                return -1;
+            }
+        }
+
         p->pict_type= FF_P_TYPE;
         if(decode_p_frame(f, buf, frame_size) < 0)
             return -1;



More information about the ffmpeg-cvslog mailing list