X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fdvdsubdec.c;h=3f8c3650ba8581bfb8936620328145c130faeecd;hb=48f37664a8b5bc43fc3dad5784f32ea2267d38a9;hp=f0dd28913944612efb529ed10207a84b5671b8ab;hpb=17e47ec8be200d54aa7ef31994e1ba5ea5f32622;p=ffmpeg diff --git a/libavcodec/dvdsubdec.c b/libavcodec/dvdsubdec.c index f0dd2891394..3f8c3650ba8 100644 --- a/libavcodec/dvdsubdec.c +++ b/libavcodec/dvdsubdec.c @@ -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;