[FFmpeg-cvslog] truemotion1: Check input buffer size against header size.

Michael Niedermayer git at videolan.org
Fri Mar 2 21:50:10 CET 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Fri Mar  2 21:36:42 2012 +0100| [e7b43e8e84e48fccf64cdc62430cb8b5c69e804c] | committer: Michael Niedermayer

truemotion1: Check input buffer size against header size.

Fixes overread.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e7b43e8e84e48fccf64cdc62430cb8b5c69e804c
---

 libavcodec/truemotion1.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libavcodec/truemotion1.c b/libavcodec/truemotion1.c
index ccebef5..767eced 100644
--- a/libavcodec/truemotion1.c
+++ b/libavcodec/truemotion1.c
@@ -314,7 +314,7 @@ static int truemotion1_decode_header(TrueMotion1Context *s)
     const uint8_t *sel_vector_table;
 
     header.header_size = ((s->buf[0] >> 5) | (s->buf[0] << 3)) & 0x7f;
-    if (s->buf[0] < 0x10)
+    if (s->buf[0] < 0x10 || header.header_size >= s->size)
     {
         av_log(s->avctx, AV_LOG_ERROR, "invalid header size (%d)\n", s->buf[0]);
         return -1;



More information about the ffmpeg-cvslog mailing list