]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/blobdiff - libavcodec/vp3.c
Visible width/height fields were added in Theora 3.2
[frescor/ffmpeg.git] / libavcodec / vp3.c
index b291cb1189d13a50084e41edbd592a98d437e525..e01ceed2373f167ab1def2cda48d70a2f4441f3a 100644 (file)
@@ -2078,8 +2078,8 @@ static int theora_decode_header(AVCodecContext *avctx, GetBitContext *gb)
         av_log(avctx, AV_LOG_DEBUG, "Old (<alpha3) Theora bitstream, flipped image\n");
     }
 
-    s->width = get_bits(gb, 16) << 4;
-    s->height = get_bits(gb, 16) << 4;
+    visible_width  = s->width  = get_bits(gb, 16) << 4;
+    visible_height = s->height = get_bits(gb, 16) << 4;
 
     if(avcodec_check_dimensions(avctx, s->width, s->height)){
         av_log(avctx, AV_LOG_ERROR, "Invalid dimensions (%dx%d)\n", s->width, s->height);
@@ -2096,10 +2096,10 @@ static int theora_decode_header(AVCodecContext *avctx, GetBitContext *gb)
         skip_bits(gb, 32); /* total number of macroblocks in a frame */
     }
 
+    if (s->theora >= 0x030200) {
     visible_width  = get_bits_long(gb, 24);
     visible_height = get_bits_long(gb, 24);
 
-    if (s->theora >= 0x030200) {
         skip_bits(gb, 8); /* offset x */
         skip_bits(gb, 8); /* offset y */
     }