[FFmpeg-cvslog] jvdec: check videosize

Michael Niedermayer git at videolan.org
Mon May 28 19:36:16 CEST 2012


ffmpeg | branch: release/0.11 | Michael Niedermayer <michaelni at gmx.at> | Mon May 28 17:21:29 2012 +0200| [61a72fd9c862a5e4260c92687c1ad1d39b84f07b] | committer: Michael Niedermayer

jvdec: check videosize

Fixes null ptr dereference
fixes Ticket1364

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit b4904e804d3b1c56ac4f5d3386b15daae98fca2d)

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavcodec/jvdec.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavcodec/jvdec.c b/libavcodec/jvdec.c
index d371950..4031fad 100644
--- a/libavcodec/jvdec.c
+++ b/libavcodec/jvdec.c
@@ -143,6 +143,10 @@ static int decode_frame(AVCodecContext *avctx,
     buf += 5;
 
     if (video_size) {
+        if(video_size < 0) {
+            av_log(avctx, AV_LOG_ERROR, "video size %d invalid\n", video_size);
+            return AVERROR_INVALIDDATA;
+        }
         if (avctx->reget_buffer(avctx, &s->frame) < 0) {
             av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
             return -1;



More information about the ffmpeg-cvslog mailing list