[Ffmpeg-cvslog] r8211 - trunk/libavcodec/h264.c

michael subversion
Sat Mar 3 22:33:33 CET 2007


Author: michael
Date: Sat Mar  3 22:33:33 2007
New Revision: 8211

Modified:
   trunk/libavcodec/h264.c

Log:
check for no frame and prevent segfault


Modified: trunk/libavcodec/h264.c
==============================================================================
--- trunk/libavcodec/h264.c	(original)
+++ trunk/libavcodec/h264.c	Sat Mar  3 22:33:33 2007
@@ -8355,6 +8355,11 @@ static int decode_frame(AVCodecContext *
     if(buf_index < 0)
         return -1;
 
+    if(!(s->flags2 & CODEC_FLAG2_CHUNKS) && !s->current_picture_ptr){
+        av_log(avctx, AV_LOG_ERROR, "no frame!\n");
+        return -1;
+    }
+
     if(!(s->flags2 & CODEC_FLAG2_CHUNKS) || (s->mb_y >= s->mb_height && s->mb_height)){
         Picture *out = s->current_picture_ptr;
         Picture *cur = s->current_picture_ptr;




More information about the ffmpeg-cvslog mailing list