[FFmpeg-cvslog] indeo3: fix data size check
Anton Khirnov
git at videolan.org
Sun May 12 13:51:24 CEST 2013
ffmpeg | branch: release/1.1 | Anton Khirnov <anton at khirnov.net> | Wed Apr 10 09:59:36 2013 +0200| [4c412580fdb689638541790cda0a920d0c13bb7b] | committer: Reinhard Tartler
indeo3: fix data size check
The data offsets are relative to the bistream header, which is 16 bytes
after the start of the data.
Fixes invalid reads with corrupted files.
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable at libav.org
(cherry picked from commit 34e6af9e204ca6bb18d8cf8ec68fe19b0e083e95)
Signed-off-by: Reinhard Tartler <siretart at tauware.de>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4c412580fdb689638541790cda0a920d0c13bb7b
---
libavcodec/indeo3.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/libavcodec/indeo3.c b/libavcodec/indeo3.c
index 261c651..2d19997 100644
--- a/libavcodec/indeo3.c
+++ b/libavcodec/indeo3.c
@@ -888,8 +888,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);
buf_ptr += 3; // skip reserved byte and checksum
More information about the ffmpeg-cvslog
mailing list