]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/dvdsubdec.c
vp8: Fix pthread_cond and pthread_mutex leaks
[ffmpeg] / libavcodec / dvdsubdec.c
index f29d278d6da90947e55d7080ffb9e26a11fb3174..ae16f05e4c5dbaa1aaa3a200ae345b1406d694d7 100644 (file)
@@ -22,6 +22,8 @@
 #include "get_bits.h"
 #include "dsputil.h"
 #include "libavutil/colorspace.h"
+#include "libavutil/imgutils.h"
+#include "libavutil/avstring.h"
 
 //#define DEBUG
 
@@ -521,9 +523,14 @@ static int dvdsub_init(AVCodecContext *avctx)
             ctx->has_palette = 1;
             for (i = 0; i < 16; i++) {
                 ctx->palette[i] = strtoul(p, &p, 16);
-                while (*p == ',' || isspace(*p))
+                while (*p == ',' || av_isspace(*p))
                     p++;
             }
+        } else if (!strncmp("size:", cur, 5)) {
+            int w, h;
+            if (sscanf(cur + 5, "%dx%d", &w, &h) == 2 &&
+                av_image_check_size(w, h, 0, avctx) >= 0)
+                avcodec_set_dimensions(avctx, w, h);
         }
         cur += strcspn(cur, "\n\r");
         cur += strspn(cur, "\n\r");