[Ffmpeg-devel] [PATCH] theora decoder crash when first frame not keyframe

Reimar Döffinger Reimar.Doeffinger
Sun Jul 9 00:06:42 CEST 2006


Hello,
attached patch fixes $subject with
http://ktown.kde.org/akademy/Leon_Shiman_MAS_in_KDE_video.ogg

Greetings,
Reimar D?ffinger
-------------- next part --------------
Index: libavcodec/vp3.c
===================================================================
--- libavcodec/vp3.c	(revision 5675)
+++ libavcodec/vp3.c	(working copy)
@@ -2494,10 +2494,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-devel mailing list