[FFmpeg-devel] [PATCH 3/4] cinepak: check strip_size

Michael Niedermayer michaelni at gmx.at
Wed Nov 16 17:43:54 CET 2011


Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
---
 libavcodec/cinepak.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/libavcodec/cinepak.c b/libavcodec/cinepak.c
index 6a8f462..a5458ca 100644
--- a/libavcodec/cinepak.c
+++ b/libavcodec/cinepak.c
@@ -375,6 +375,8 @@ static int cinepak_decode (CinepakContext *s)
             s->frame.key_frame = 1;
 
         strip_size = AV_RB24 (&s->data[1]) - 12;
+        if(strip_size < 0)
+            return -1;
         s->data   += 12;
         strip_size = ((s->data + strip_size) > eod) ? (eod - s->data) : strip_size;
 
-- 
1.7.4.1



More information about the ffmpeg-devel mailing list