[FFmpeg-devel] [HACK] avoid crash in issue 905

Reimar Döffinger Reimar.Doeffinger
Thu Apr 9 13:52:53 CEST 2009


Hello,
attached patch fixes the crash reported in issue 905.
I think it is a hack, because IMO delayed_pic != NULL but
delayed_pic.data[0] == NULL should never happen.
Also, when delayed_pic is assigned a value, its data[0] is
never NULL, so I suspect that some AVFrame is freed while it is
still held in delayed_pic, but I have no idea where the code that
is responsible for that might be.
-------------- next part --------------
Index: libavcodec/h264.c
===================================================================
--- libavcodec/h264.c	(revision 18382)
+++ libavcodec/h264.c	(working copy)
@@ -7865,7 +7865,7 @@
                 for(i=out_idx; h->delayed_pic[i]; i++)
                     h->delayed_pic[i] = h->delayed_pic[i+1];
             }
-            if(!out_of_order && pics > s->avctx->has_b_frames){
+            if(!out_of_order && pics > s->avctx->has_b_frames && out->data[0]){
                 *data_size = sizeof(AVFrame);
 
                 h->outputed_poc = out->poc;



More information about the ffmpeg-devel mailing list