Commit 256b986c authored by Paul B Mahol's avatar Paul B Mahol

avcodec/exr: stop using deprecated avcodec_set_dimensions()

Signed-off-by: 's avatarPaul B Mahol <onemda@gmail.com>
parent 01507ab3
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
#include "get_bits.h" #include "get_bits.h"
#include "avcodec.h" #include "avcodec.h"
#include "bytestream.h" #include "bytestream.h"
#include "internal.h"
#include "mathops.h" #include "mathops.h"
#include "thread.h" #include "thread.h"
#include "libavutil/imgutils.h" #include "libavutil/imgutils.h"
...@@ -1184,9 +1185,6 @@ static int decode_frame(AVCodecContext *avctx, ...@@ -1184,9 +1185,6 @@ static int decode_frame(AVCodecContext *avctx,
return AVERROR_PATCHWELCOME; return AVERROR_PATCHWELCOME;
} }
if (av_image_check_size(w, h, 0, avctx))
return AVERROR_INVALIDDATA;
// Verify the xmin, xmax, ymin, ymax and xdelta before setting the actual image size // Verify the xmin, xmax, ymin, ymax and xdelta before setting the actual image size
if (s->xmin > s->xmax || if (s->xmin > s->xmax ||
s->ymin > s->ymax || s->ymin > s->ymax ||
...@@ -1196,9 +1194,8 @@ static int decode_frame(AVCodecContext *avctx, ...@@ -1196,9 +1194,8 @@ static int decode_frame(AVCodecContext *avctx,
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
} }
if (w != avctx->width || h != avctx->height) { if ((ret = ff_set_dimensions(avctx, w, h)) < 0)
avcodec_set_dimensions(avctx, w, h); return ret;
}
s->desc = av_pix_fmt_desc_get(avctx->pix_fmt); s->desc = av_pix_fmt_desc_get(avctx->pix_fmt);
out_line_size = avctx->width * 2 * s->desc->nb_components; out_line_size = avctx->width * 2 * s->desc->nb_components;
......
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