[FFmpeg-cvslog] dpx: include offset in the total_size calculation

Michael Niedermayer git at videolan.org
Sun Feb 10 18:10:09 CET 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun Feb 10 17:54:00 2013 +0100| [cb85779d459c6486acbbf060b3f169779424583e] | committer: Michael Niedermayer

dpx: include offset in the  total_size calculation

Fixes out of array reads

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=cb85779d459c6486acbbf060b3f169779424583e
---

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

diff --git a/libavcodec/dpx.c b/libavcodec/dpx.c
index 0237b44..310036b 100644
--- a/libavcodec/dpx.c
+++ b/libavcodec/dpx.c
@@ -199,7 +199,7 @@ static int decode_frame(AVCodecContext *avctx,
     for (i=0; i<AV_NUM_DATA_POINTERS; i++)
         ptr[i] = p->data[i];
 
-    if (total_size > avpkt->size) {
+    if (total_size + (int64_t)offset > avpkt->size) {
         av_log(avctx, AV_LOG_ERROR, "Overread buffer. Invalid header?\n");
         return AVERROR_INVALIDDATA;
     }



More information about the ffmpeg-cvslog mailing list