summaryrefslogtreecommitdiff
path: root/libavcodec/libopenjpegdec.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec/libopenjpegdec.c')
-rw-r--r--libavcodec/libopenjpegdec.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/libavcodec/libopenjpegdec.c b/libavcodec/libopenjpegdec.c
index 93f47a21d5..0543e3a897 100644
--- a/libavcodec/libopenjpegdec.c
+++ b/libavcodec/libopenjpegdec.c
@@ -32,6 +32,7 @@
#include "libavutil/pixfmt.h"
#include "libavutil/opt.h"
#include "avcodec.h"
+#include "internal.h"
#include "thread.h"
#if HAVE_OPENJPEG_1_5_OPENJPEG_H
@@ -296,13 +297,9 @@ static int libopenjpeg_decode_frame(AVCodecContext *avctx,
width = image->x1 - image->x0;
height = image->y1 - image->y0;
- if ((ret = av_image_check_size(width, height, 0, avctx)) < 0) {
- av_log(avctx, AV_LOG_ERROR,
- "%dx%d dimension invalid.\n", width, height);
+ ret = ff_set_dimensions(avctx, width, height);
+ if (ret < 0)
goto done;
- }
-
- avcodec_set_dimensions(avctx, width, height);
if (avctx->pix_fmt != AV_PIX_FMT_NONE)
if (!libopenjpeg_matches_pix_fmt(image, avctx->pix_fmt))