diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-12-18 18:57:27 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-12-30 15:38:21 +0100 |
commit | d3853ad11f216cb57edf7b1f2bfbc49449fb8f65 (patch) | |
tree | 17d921e97bf4665e364ff2c2fa30e7d292e32621 /libavcodec | |
parent | b188ff5e183de064eb1eeb95fd88a0a74a747a8c (diff) | |
download | ffmpeg-d3853ad11f216cb57edf7b1f2bfbc49449fb8f65.tar.gz |
avcodec/indeo3: ensure offsets are non negative
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 368642361f3a589d7b0c23ea327d988edb434e3f)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/indeo3.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/indeo3.c b/libavcodec/indeo3.c index ea8e4d8238..b6633f8c15 100644 --- a/libavcodec/indeo3.c +++ b/libavcodec/indeo3.c @@ -981,7 +981,8 @@ static int decode_frame_headers(Indeo3DecodeContext *ctx, AVCodecContext *avctx, ctx->y_data_size = ends[0] - starts[0]; ctx->v_data_size = ends[1] - starts[1]; ctx->u_data_size = ends[2] - starts[2]; - if (FFMAX3(y_offset, v_offset, u_offset) >= ctx->data_size - 16 || + if (FFMIN3(y_offset, v_offset, u_offset) < 0 || + FFMAX3(y_offset, v_offset, u_offset) >= ctx->data_size - 16 || FFMIN3(y_offset, v_offset, u_offset) < gb.buffer - bs_hdr + 16 || FFMIN3(ctx->y_data_size, ctx->v_data_size, ctx->u_data_size) <= 0) { av_log(avctx, AV_LOG_ERROR, "One of the y/u/v offsets is invalid\n"); |