]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/oggparsetheora.c
Merge commit 'eb5920c195d1b0bda81782af4ba0c5982f5225b3'
[ffmpeg] / libavformat / oggparsetheora.c
index 0a0ea067852a4f9de6b3cc85960e2bfd4bdbb813..6458b97bc0ab580dd245ad1fa4fd9b3c88c0a037 100644 (file)
@@ -58,7 +58,6 @@ static int theora_header(AVFormatContext *s, int idx)
     switch (os->buf[os->pstart]) {
     case 0x80: {
         GetBitContext gb;
-        int width, height;
         AVRational timebase;
 
         init_get_bits(&gb, os->buf + os->pstart, os->psize * 8);
@@ -73,19 +72,20 @@ static int theora_header(AVFormatContext *s, int idx)
             return AVERROR(ENOSYS);
         }
 
-        width  = get_bits(&gb, 16) << 4;
-        height = get_bits(&gb, 16) << 4;
-        avcodec_set_dimensions(st->codec, width, height);
+        st->codec->width  = get_bits(&gb, 16) << 4;
+        st->codec->height = get_bits(&gb, 16) << 4;
 
         if (thp->version >= 0x030400)
             skip_bits(&gb, 100);
 
         if (thp->version >= 0x030200) {
-            width  = get_bits_long(&gb, 24);
-            height = get_bits_long(&gb, 24);
+            int width  = get_bits_long(&gb, 24);
+            int height = get_bits_long(&gb, 24);
             if (width  <= st->codec->width  && width  > st->codec->width  - 16 &&
-                height <= st->codec->height && height > st->codec->height - 16)
-                avcodec_set_dimensions(st->codec, width, height);
+                height <= st->codec->height && height > st->codec->height - 16) {
+                st->codec->width  = width;
+                st->codec->height = height;
+            }
 
             skip_bits(&gb, 16);
         }