| @@ -209,7 +209,7 @@ void avcodec_set_dimensions(AVCodecContext *s, int width, int height) · 208 unmodified lines |
| 209 | | 209 | |
| 210 | int ff_set_dimensions(AVCodecContext *s, int width, int height) | 210 | int ff_set_dimensions(AVCodecContext *s, int width, int height) |
| 211 | { | 211 | { |
| 212 | int ret = av_image_check_size(width, height, 0, s); | 212 | int ret = av_image_check_size2(width, height, s->max_pixels, AV_PIX_FMT_NONE, 0, s); |
| 213 | | 213 | |
| 214 | if (ret < 0) | 214 | if (ret < 0) |
| 215 | width = height = 0; | 215 | width = height = 0; |
| @@ -904,7 +904,7 @@ static int get_buffer_internal(AVCodecContext *avctx, AVFrame *frame, int flags) · 688 unmodified lines |
| 904 | int ret; | 904 | int ret; |
| 905 | | 905 | |
| 906 | if (avctx->codec_type == AVMEDIA_TYPE_VIDEO) { | 906 | if (avctx->codec_type == AVMEDIA_TYPE_VIDEO) { |
| 907 | if ((ret = av_image_check_size(avctx->width, avctx->height, 0, avctx)) < 0 || avctx->pix_fmt<0) { | 907 | if ((ret = av_image_check_size2(avctx->width, avctx->height, avctx->max_pixels, AV_PIX_FMT_NONE, 0, avctx)) < 0 || avctx->pix_fmt<0) { |
| 908 | av_log(avctx, AV_LOG_ERROR, "video_get_buffer: image parameters invalid\n"); | 908 | av_log(avctx, AV_LOG_ERROR, "video_get_buffer: image parameters invalid\n"); |
| 909 | return AVERROR(EINVAL); | 909 | return AVERROR(EINVAL); |
| 910 | } | 910 | } |
| @@ -1338,8 +1338,8 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *code · 427 unmodified lines |
| 1338 | } | 1338 | } |
| 1339 | | 1339 | |
| 1340 | if ((avctx->coded_width || avctx->coded_height || avctx->width || avctx->height) | 1340 | if ((avctx->coded_width || avctx->coded_height || avctx->width || avctx->height) |
| 1341 | && ( av_image_check_size(avctx->coded_width, avctx->coded_height, 0, avctx) < 0 | 1341 | && ( av_image_check_size2(avctx->coded_width, avctx->coded_height, avctx->max_pixels, AV_PIX_FMT_NONE, 0, avctx) < 0 |
| 1342 | || av_image_check_size(avctx->width, avctx->height, 0, avctx) < 0)) { | 1342 | || av_image_check_size2(avctx->width, avctx->height, avctx->max_pixels, AV_PIX_FMT_NONE, 0, avctx) < 0)) { |
| 1343 | av_log(avctx, AV_LOG_WARNING, "Ignoring invalid width/height values\n"); | 1343 | av_log(avctx, AV_LOG_WARNING, "Ignoring invalid width/height values\n"); |
| 1344 | ff_set_dimensions(avctx, 0, 0); | 1344 | ff_set_dimensions(avctx, 0, 0); |
| 1345 | } | 1345 | } |
| @@ -1982,7 +1982,7 @@ int attribute_align_arg avcodec_encode_video2(AVCodecContext *avctx, · 636 unmodified lines |
| 1982 | return 0; | 1982 | return 0; |
| 1983 | } | 1983 | } |
| 1984 | | 1984 | |
| 1985 | if (av_image_check_size(avctx->width, avctx->height, 0, avctx)) | 1985 | if (av_image_check_size2(avctx->width, avctx->height, avctx->max_pixels, AV_PIX_FMT_NONE, 0, avctx)) |
| 1986 | return AVERROR(EINVAL); | 1986 | return AVERROR(EINVAL); |
| 1987 | | 1987 | |
| 1988 | if (frame && frame->format == AV_PIX_FMT_NONE) | 1988 | if (frame && frame->format == AV_PIX_FMT_NONE) |
| @@ -2233,7 +2233,7 @@ int attribute_align_arg avcodec_decode_video2(AVCodecContext *avctx, AVFrame *pi · 244 unmodified lines |
| 2233 | } | 2233 | } |
| 2234 | | 2234 | |
| 2235 | *got_picture_ptr = 0; | 2235 | *got_picture_ptr = 0; |
| 2236 | if ((avctx->coded_width || avctx->coded_height) && av_image_check_size(avctx->coded_width, avctx->coded_height, 0, avctx)) | 2236 | if ((avctx->coded_width || avctx->coded_height) && av_image_check_size2(avctx->coded_width, avctx->coded_height, avctx->max_pixels, AV_PIX_FMT_NONE, 0, avctx)) |
| 2237 | return AVERROR(EINVAL); | 2237 | return AVERROR(EINVAL); |
| 2238 | | 2238 | |
| 2239 | avctx->internal->pkt = avpkt; | 2239 | avctx->internal->pkt = avpkt; |