eatqi: replace break by goto.
authorMichael Niedermayer <michaelni@gmx.at>
Thu, 22 Mar 2012 23:27:59 +0000 (00:27 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Thu, 22 Mar 2012 23:50:43 +0000 (00:50 +0100)
This fixes some heap overread.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/eatqi.c

index 5b7ff39..337fa8e 100644 (file)
@@ -139,9 +139,10 @@ static int tqi_decode_frame(AVCodecContext *avctx,
     for (s->mb_x=0; s->mb_x<(avctx->width+15)/16; s->mb_x++)
     {
         if(tqi_decode_mb(s, t->block) < 0)
-            break;
+            goto end;
         tqi_idct_put(t, t->block);
     }
+    end:
 
     *data_size = sizeof(AVFrame);
     *(AVFrame*)data = t->frame;