changeset 4620:f23c20cf7579 libavcodec

check for no frame and prevent segfault
author michael
date Sat, 03 Mar 2007 21:33:33 +0000
parents 9358bf66a1d0
children 5464e5021a67
files h264.c
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
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;