diff h264.c @ 4620:f23c20cf7579 libavcodec

check for no frame and prevent segfault
author michael
date Sat, 03 Mar 2007 21:33:33 +0000
parents 8036b117ae26
children f7c444dc3b04
line wrap: on
line diff
--- a/h264.c	Sat Mar 03 14:11:45 2007 +0000
+++ b/h264.c	Sat Mar 03 21:33:33 2007 +0000
@@ -8355,6 +8355,11 @@
     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;