[FFmpeg-cvslog] adx: check that the offset is not negative

Anton Khirnov git at videolan.org
Tue Jun 3 02:17:25 CEST 2014


ffmpeg | branch: release/0.10 | Anton Khirnov <anton at khirnov.net> | Thu Nov 28 10:54:35 2013 +0100| [d0ecfe32492bbf27274bbb0c525d2ea59518cd5f] | committer: Reinhard Tartler

adx: check that the offset is not negative

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable at libav.org
(cherry picked from commit 5569146d48f06564e8fa393424782cceed510916)

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

 libavcodec/adx.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/adx.c b/libavcodec/adx.c
index 1e5d89c..41e8e1c 100644
--- a/libavcodec/adx.c
+++ b/libavcodec/adx.c
@@ -47,7 +47,7 @@ int avpriv_adx_decode_header(AVCodecContext *avctx, const uint8_t *buf,
     offset = AV_RB16(buf + 2) + 4;
 
     /* if copyright string is within the provided data, validate it */
-    if (bufsize >= offset && memcmp(buf + offset - 6, "(c)CRI", 6))
+    if (bufsize >= offset && offset >= 6 && memcmp(buf + offset - 6, "(c)CRI", 6))
         return AVERROR_INVALIDDATA;
 
     /* check for encoding=3 block_size=18, sample_size=4 */



More information about the ffmpeg-cvslog mailing list