yopdec: check frame oddness to be within supported limits
authorMichael Niedermayer <michaelni@gmx.at>
Fri, 1 Jun 2012 13:52:20 +0000 (15:52 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sat, 9 Jun 2012 18:47:19 +0000 (20:47 +0200)
Fixes Ticket1365

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

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

index bf8a000..fe52f53 100644 (file)
@@ -224,6 +224,10 @@ static int yop_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
     s->low_nibble = NULL;
 
     is_odd_frame = avpkt->data[0];
+    if(is_odd_frame>1){
+        av_log(avctx, AV_LOG_ERROR, "frame is too odd %d\n", is_odd_frame);
+        return AVERROR_INVALIDDATA;
+    }
     firstcolor   = s->first_color[is_odd_frame];
     palette      = (uint32_t *)s->frame.data[1];