summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libavcodec/avs.c2
-rw-r--r--libavcodec/cdxl.c4
-rw-r--r--libavcodec/dirac.c6
-rw-r--r--libavcodec/dnxhddec.c6
4 files changed, 8 insertions, 10 deletions
diff --git a/libavcodec/avs.c b/libavcodec/avs.c
index 065345b5cd..abfe54de13 100644
--- a/libavcodec/avs.c
+++ b/libavcodec/avs.c
@@ -160,7 +160,7 @@ static av_cold int avs_decode_init(AVCodecContext * avctx)
{
AvsContext *s = avctx->priv_data;
avctx->pix_fmt = AV_PIX_FMT_PAL8;
- avcodec_set_dimensions(avctx, 318, 198);
+ ff_set_dimensions(avctx, 318, 198);
avcodec_get_frame_defaults(&s->picture);
return 0;
}
diff --git a/libavcodec/cdxl.c b/libavcodec/cdxl.c
index 93a5537e3e..13ad57c8c1 100644
--- a/libavcodec/cdxl.c
+++ b/libavcodec/cdxl.c
@@ -245,10 +245,8 @@ static int cdxl_decode_frame(AVCodecContext *avctx, void *data,
return AVERROR_PATCHWELCOME;
}
- if ((ret = av_image_check_size(w, h, 0, avctx)) < 0)
+ if ((ret = ff_set_dimensions(avctx, w, h)) < 0)
return ret;
- if (w != avctx->width || h != avctx->height)
- avcodec_set_dimensions(avctx, w, h);
aligned_width = FFALIGN(c->avctx->width, 16);
c->padded_bits = aligned_width - c->avctx->width;
diff --git a/libavcodec/dirac.c b/libavcodec/dirac.c
index e132acc44a..3dad75a30c 100644
--- a/libavcodec/dirac.c
+++ b/libavcodec/dirac.c
@@ -30,6 +30,7 @@
#include "dirac.h"
#include "avcodec.h"
#include "golomb.h"
+#include "internal.h"
#include "mpeg12data.h"
/* defaults for source parameters */
@@ -317,11 +318,10 @@ int avpriv_dirac_parse_sequence_header(AVCodecContext *avctx, GetBitContext *gb,
if (ret = parse_source_parameters(avctx, gb, source))
return ret;
- if (ret = av_image_check_size(source->width, source->height, 0, avctx))
+ ret = ff_set_dimensions(avctx, source->width, source->height);
+ if (ret < 0)
return ret;
- avcodec_set_dimensions(avctx, source->width, source->height);
-
/* [DIRAC_STD] picture_coding_mode shall be 0 for fields and 1 for frames
* currently only used to signal field coding */
picture_coding_mode = svq3_get_ue_golomb(gb);
diff --git a/libavcodec/dnxhddec.c b/libavcodec/dnxhddec.c
index 15e6c679e4..42775dfd2b 100644
--- a/libavcodec/dnxhddec.c
+++ b/libavcodec/dnxhddec.c
@@ -377,9 +377,9 @@ static int dnxhd_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
first_field = 1;
}
- if (av_image_check_size(ctx->width, ctx->height, 0, avctx))
- return -1;
- avcodec_set_dimensions(avctx, ctx->width, ctx->height);
+ ret = ff_set_dimensions(avctx, ctx->width, ctx->height);
+ if (ret < 0)
+ return ret;
if (first_field) {
if ((ret = ff_thread_get_buffer(avctx, &frame, 0)) < 0)