[FFmpeg-cvslog] eacmv: check for out of bound reads
Laurent Aimar
git at videolan.org
Mon Mar 19 05:30:38 CET 2012
ffmpeg | branch: release/0.8 | Laurent Aimar <fenrir at videolan.org> | Fri Sep 30 23:42:32 2011 +0000| [d75c80e9427eef962b1de8ce3dd0246dd2ec5c05] | committer: Reinhard Tartler
eacmv: check for out of bound reads
Signed-off-by: Janne Grunau <janne-libav at jannau.net>
(cherry picked from commit 46cb2f6a2928a7fa4bee3f09b0475ccb8cdd2064)
Signed-off-by: Anton Khirnov <anton at khirnov.net>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d75c80e9427eef962b1de8ce3dd0246dd2ec5c05
---
libavcodec/eacmv.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/libavcodec/eacmv.c b/libavcodec/eacmv.c
index d848208..2b9e680 100644
--- a/libavcodec/eacmv.c
+++ b/libavcodec/eacmv.c
@@ -153,6 +153,9 @@ static int cmv_decode_frame(AVCodecContext *avctx,
CmvContext *s = avctx->priv_data;
const uint8_t *buf_end = buf + buf_size;
+ if (buf_end - buf < EA_PREAMBLE_SIZE)
+ return AVERROR_INVALIDDATA;
+
if (AV_RL32(buf)==MVIh_TAG||AV_RB32(buf)==MVIh_TAG) {
cmv_process_header(s, buf+EA_PREAMBLE_SIZE, buf_end);
return buf_size;
More information about the ffmpeg-cvslog
mailing list