Commit 967cd6fa authored by Anton Khirnov's avatar Anton Khirnov

libopenjpegdec: stop using deprecated avcodec_set_dimensions

parent d62b24a3
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
#include "libavutil/pixfmt.h" #include "libavutil/pixfmt.h"
#include "libavutil/opt.h" #include "libavutil/opt.h"
#include "avcodec.h" #include "avcodec.h"
#include "internal.h"
#include "thread.h" #include "thread.h"
#define JP2_SIG_TYPE 0x6A502020 #define JP2_SIG_TYPE 0x6A502020
...@@ -315,13 +316,9 @@ static int libopenjpeg_decode_frame(AVCodecContext *avctx, ...@@ -315,13 +316,9 @@ static int libopenjpeg_decode_frame(AVCodecContext *avctx,
height = (height + (1 << ctx->lowres) - 1) >> ctx->lowres; height = (height + (1 << ctx->lowres) - 1) >> ctx->lowres;
} }
if ((ret = av_image_check_size(width, height, 0, avctx)) < 0) { ret = ff_set_dimensions(avctx, width, height);
av_log(avctx, AV_LOG_ERROR, if (ret < 0)
"%dx%d dimension invalid.\n", width, height);
goto done; goto done;
}
avcodec_set_dimensions(avctx, width, height);
if (avctx->pix_fmt != AV_PIX_FMT_NONE) if (avctx->pix_fmt != AV_PIX_FMT_NONE)
if (!libopenjpeg_matches_pix_fmt(image, avctx->pix_fmt)) if (!libopenjpeg_matches_pix_fmt(image, avctx->pix_fmt))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment