[Ffmpeg-cvslog] r5815 - trunk/libavcodec/vp3.c

reimar subversion
Sun Jul 23 20:22:30 CEST 2006


Author: reimar
Date: Sun Jul 23 20:22:29 2006
New Revision: 5815

Modified:
   trunk/libavcodec/vp3.c

Log:
Do not crash when the first frame is not a keyframe (and thus none of the
necessary initialization has been done yet).


Modified: trunk/libavcodec/vp3.c
==============================================================================
--- trunk/libavcodec/vp3.c	(original)
+++ trunk/libavcodec/vp3.c	Sun Jul 23 20:22:29 2006
@@ -2235,10 +2235,15 @@
                 vp3_calculate_pixel_addresses(s);
             else
                 theora_calculate_pixel_addresses(s);
+            s->pixel_addresses_inited = 1;
         }
     } else {
         /* allocate a new current frame */
         s->current_frame.reference = 3;
+        if (!s->pixel_addresses_inited) {
+            av_log(s->avctx, AV_LOG_ERROR, "vp3: first frame not a keyframe\n");
+            return -1;
+        }
         if(avctx->get_buffer(avctx, &s->current_frame) < 0) {
             av_log(s->avctx, AV_LOG_ERROR, "vp3: get_buffer() failed\n");
             return -1;




More information about the ffmpeg-cvslog mailing list