mmvideo/mm_decode_intra: check horizontal coordinate too
authorMichael Niedermayer <michaelni@gmx.at>
Thu, 2 May 2013 20:06:03 +0000 (22:06 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Mon, 13 May 2013 23:29:11 +0000 (01:29 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit ae2132ac90f02330b0988e6e26ee0d53e41cd196)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/mmvideo.c

index aebfe26..40892a7 100644 (file)
@@ -104,6 +104,9 @@ static int mm_decode_intra(MmContext * s, int half_horiz, int half_vert)
         if (half_horiz)
             run_length *=2;
 
+        if (run_length > s->avctx->width - x)
+            return AVERROR_INVALIDDATA;
+
         if (color) {
             memset(s->frame.data[0] + y*s->frame.linesize[0] + x, color, run_length);
             if (half_vert)