changeset 3103:cfc5b4a05633 libavcodec

fix segfault on broken streams
author michael
date Thu, 09 Feb 2006 09:38:03 +0000
parents fcc2892eeab3
children 78d6bfc238f3
files ffv1.c
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ffv1.c	Thu Feb 09 02:43:23 2006 +0000
+++ b/ffv1.c	Thu Feb 09 09:38:03 2006 +0000
@@ -959,11 +959,14 @@
     p->pict_type= FF_I_TYPE; //FIXME I vs. P
     if(get_rac(c, &keystate)){
         p->key_frame= 1;
-        read_header(f);
+        if(read_header(f) < 0)
+            return -1;
         clear_state(f);
     }else{
         p->key_frame= 0;
     }
+    if(!f->plane[0].state && !f->plane[0].vlc_state)
+        return -1;
 
     p->reference= 0;
     if(avctx->get_buffer(avctx, p) < 0){