diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-11-01 14:01:02 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-11-01 14:01:02 +0100 |
commit | 4a356512676629b4a289ea33f2b39b5f151cfae3 (patch) | |
tree | c4391d9281d285e0c5c53a4000a3918de7dbaf31 /libavcodec/eacmv.c | |
parent | f016a23c7fa0b089a394e25eeefa5d5f4d99d926 (diff) | |
parent | d6da372984c87fd6288c148c291065d6032ceda3 (diff) | |
download | ffmpeg-4a356512676629b4a289ea33f2b39b5f151cfae3.tar.gz |
Merge commit 'd6da372984c87fd6288c148c291065d6032ceda3'
* commit 'd6da372984c87fd6288c148c291065d6032ceda3':
eacmv: stop using deprecated avcodec_set_dimensions
dvdsubdec: stop using deprecated avcodec_set_dimensions
dvdec: stop using deprecated avcodec_set_dimensions
dpx: stop using deprecated avcodec_set_dimensions
Conflicts:
libavcodec/dpx.c
libavcodec/dvdec.c
libavcodec/dvdsubdec.c
libavcodec/eacmv.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/eacmv.c')
-rw-r--r-- | libavcodec/eacmv.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/libavcodec/eacmv.c b/libavcodec/eacmv.c index 3f22c74798..b3ffb3f07b 100644 --- a/libavcodec/eacmv.c +++ b/libavcodec/eacmv.c @@ -130,21 +130,23 @@ static void cmv_decode_inter(CmvContext *s, AVFrame *frame, const uint8_t *buf, } } -static void cmv_process_header(CmvContext *s, const uint8_t *buf, const uint8_t *buf_end) +static int cmv_process_header(CmvContext *s, const uint8_t *buf, const uint8_t *buf_end) { - int pal_start, pal_count, i; + int pal_start, pal_count, i, ret; if(buf_end - buf < 16) { av_log(s->avctx, AV_LOG_WARNING, "truncated header\n"); - return; + return AVERROR_INVALIDDATA; } s->width = AV_RL16(&buf[4]); s->height = AV_RL16(&buf[6]); if (s->avctx->width!=s->width || s->avctx->height!=s->height) { - avcodec_set_dimensions(s->avctx, s->width, s->height); av_frame_unref(s->last_frame); av_frame_unref(s->last2_frame); + ret = ff_set_dimensions(s->avctx, s->width, s->height); + if (ret < 0) + return ret; } s->avctx->time_base.num = 1; @@ -158,6 +160,8 @@ static void cmv_process_header(CmvContext *s, const uint8_t *buf, const uint8_t s->palette[i] = 0xFFU << 24 | AV_RB24(buf); buf += 3; } + + return 0; } #define EA_PREAMBLE_SIZE 8 @@ -179,7 +183,9 @@ static int cmv_decode_frame(AVCodecContext *avctx, if (AV_RL32(buf)==MVIh_TAG||AV_RB32(buf)==MVIh_TAG) { unsigned size = AV_RL32(buf + 4); - cmv_process_header(s, buf+EA_PREAMBLE_SIZE, buf_end); + ret = cmv_process_header(s, buf+EA_PREAMBLE_SIZE, buf_end); + if (ret < 0) + return ret; if (size > buf_end - buf - EA_PREAMBLE_SIZE) return -1; buf += size; |