[FFmpeg-cvslog] vpriv_adx_decode_header: avoid underreading the array.

Michael Niedermayer git at videolan.org
Wed Nov 14 19:28:46 CET 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Wed Nov 14 19:15:32 2012 +0100| [30bce34b6719ca99ad72c62e2fba3eade71f1eae] | committer: Michael Niedermayer

vpriv_adx_decode_header: avoid underreading the array.

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=30bce34b6719ca99ad72c62e2fba3eade71f1eae
---

 libavcodec/adx.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavcodec/adx.c b/libavcodec/adx.c
index 870216c..7da696d 100644
--- a/libavcodec/adx.c
+++ b/libavcodec/adx.c
@@ -47,6 +47,11 @@ int avpriv_adx_decode_header(AVCodecContext *avctx, const uint8_t *buf,
         return AVERROR_INVALIDDATA;
     offset = AV_RB16(buf + 2) + 4;
 
+    if (offset < 6) {
+        av_log(avctx, AV_LOG_ERROR, "offset is prior data\n");
+        return AVERROR_INVALIDDATA;
+    }
+
     /* if copyright string is within the provided data, validate it */
     if (bufsize >= offset && memcmp(buf + offset - 6, "(c)CRI", 6))
         return AVERROR_INVALIDDATA;



More information about the ffmpeg-cvslog mailing list