]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/dvdsubdec.c
Merge remote-tracking branch 'qatar/master'
[ffmpeg] / libavcodec / dvdsubdec.c
index f0dd28913944612efb529ed10207a84b5671b8ab..3f8c3650ba8581bfb8936620328145c130faeecd 100644 (file)
@@ -21,6 +21,8 @@
 #include "avcodec.h"
 #include "get_bits.h"
 #include "dsputil.h"
+#include "internal.h"
+
 #include "libavutil/attributes.h"
 #include "libavutil/colorspace.h"
 #include "libavutil/opt.h"
@@ -460,9 +462,6 @@ static int find_smallest_bounding_rectangle(AVSubtitle *s)
 }
 
 #ifdef DEBUG
-#undef fprintf
-#undef perror
-#undef exit
 static void ppm_save(const char *filename, uint8_t *bitmap, int w, int h,
                      uint32_t *rgba_palette)
 {
@@ -598,9 +597,11 @@ static int dvdsub_parse_extradata(AVCodecContext *avctx)
             parse_palette(ctx, data + 8);
         } else if (strncmp("size:", data, 5) == 0) {
             int w, h;
-            if (sscanf(data + 5, "%dx%d", &w, &h) == 2 &&
-                av_image_check_size(w, h, 0, avctx) >= 0)
-                avcodec_set_dimensions(avctx, w, h);
+            if (sscanf(data + 5, "%dx%d", &w, &h) == 2) {
+               int ret = ff_set_dimensions(avctx, w, h);
+               if (ret < 0)
+                   return ret;
+            }
         }
 
         data += pos;