summaryrefslogtreecommitdiff
path: root/libavcodec/indeo3.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-04-17 16:55:27 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-04-17 16:57:45 +0200
commit2787f7b188f5e92bc9dc945035e2e0729f7669cd (patch)
tree37493fea82248512a6d5810ae462c2ebfac7f048 /libavcodec/indeo3.c
parent4029a5ebc2f959d86a83edff6f72935c783f579e (diff)
parent34e6af9e204ca6bb18d8cf8ec68fe19b0e083e95 (diff)
Merge commit '34e6af9e204ca6bb18d8cf8ec68fe19b0e083e95'
* commit '34e6af9e204ca6bb18d8cf8ec68fe19b0e083e95': indeo3: fix data size check Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/indeo3.c')
-rw-r--r--libavcodec/indeo3.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/libavcodec/indeo3.c b/libavcodec/indeo3.c
index 949ab087c0..578dd2f30e 100644
--- a/libavcodec/indeo3.c
+++ b/libavcodec/indeo3.c
@@ -916,7 +916,6 @@ static int decode_frame_headers(Indeo3DecodeContext *ctx, AVCodecContext *avctx,
/* parse the bitstream header */
bs_hdr = gb.buffer;
- buf_size -= 16;
if (bytestream2_get_le16(&gb) != 32) {
av_log(avctx, AV_LOG_ERROR, "Unsupported codec version!\n");
@@ -930,8 +929,7 @@ static int decode_frame_headers(Indeo3DecodeContext *ctx, AVCodecContext *avctx,
if (ctx->data_size == 16)
return 4;
- if (ctx->data_size > buf_size)
- ctx->data_size = buf_size;
+ ctx->data_size = FFMIN(ctx->data_size, buf_size - 16);
bytestream2_skip(&gb, 3); // skip reserved byte and checksum