diff --git a/libavcodec/g2meet.c b/libavcodec/g2meet.c index 16671497d6..acd9b19cc6 100644 --- a/libavcodec/g2meet.c +++ b/libavcodec/g2meet.c @@ -701,7 +701,7 @@ static int g2m_decode_frame(AVCodecContext *avctx, void *data, goto header_fail; } if (c->width != avctx->width || c->height != avctx->height) - avcodec_set_dimensions(avctx, c->width, c->height); + ff_set_dimensions(avctx, c->width, c->height); c->compression = bytestream2_get_be32(&bc); if (c->compression != 2 && c->compression != 3) { av_log(avctx, AV_LOG_ERROR, diff --git a/libavcodec/gifdec.c b/libavcodec/gifdec.c index 4151b88856..ec1585cbca 100644 --- a/libavcodec/gifdec.c +++ b/libavcodec/gifdec.c @@ -463,9 +463,8 @@ static int gif_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, A if ((ret = gif_read_header1(s)) < 0) return ret; - if ((ret = av_image_check_size(s->screen_width, s->screen_height, 0, avctx)) < 0) + if ((ret = ff_set_dimensions(avctx, s->screen_width, s->screen_height)) < 0) return ret; - avcodec_set_dimensions(avctx, s->screen_width, s->screen_height); av_frame_unref(s->frame); if ((ret = ff_get_buffer(avctx, s->frame, 0)) < 0) diff --git a/libavcodec/h261dec.c b/libavcodec/h261dec.c index 26b885587f..241099eeff 100644 --- a/libavcodec/h261dec.c +++ b/libavcodec/h261dec.c @@ -30,6 +30,7 @@ #include "mpegvideo.h" #include "h263.h" #include "h261.h" +#include "internal.h" #define H261_MBA_VLC_BITS 9 #define H261_MTYPE_VLC_BITS 6 @@ -609,7 +610,9 @@ retry: s->parse_context = pc; } if (!s->context_initialized) { - avcodec_set_dimensions(avctx, s->width, s->height); + ret = ff_set_dimensions(avctx, s->width, s->height); + if (ret < 0) + return ret; goto retry; } diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c index 40d223736a..e7030d1cbb 100644 --- a/libavcodec/h263dec.c +++ b/libavcodec/h263dec.c @@ -630,7 +630,9 @@ retry: /* H.263 could change picture size any time */ s->context_reinit = 0; - avcodec_set_dimensions(avctx, s->width, s->height); + ret = ff_set_dimensions(avctx, s->width, s->height); + if (ret < 0) + return ret; if ((ret = ff_MPV_common_frame_size_change(s))) return ret;