[FFmpeg-cvslog] tqi: Fix passing errors from the MB decode. This silences some valgrind warnings.

Michael Niedermayer git at videolan.org
Mon Dec 19 04:24:00 CET 2011


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Mon Dec 19 04:13:37 2011 +0100| [f85334f58e1286287d0547a49fa9c93b40cbf48f] | committer: Michael Niedermayer

tqi: Fix passing errors from the MB decode. This silences some valgrind warnings.
Fixes second half of Ticket794
Bug found by: Oana Stratulat

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

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

 libavcodec/eatqi.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/libavcodec/eatqi.c b/libavcodec/eatqi.c
index a1ad814..245c143 100644
--- a/libavcodec/eatqi.c
+++ b/libavcodec/eatqi.c
@@ -57,12 +57,15 @@ static av_cold int tqi_decode_init(AVCodecContext *avctx)
     return 0;
 }
 
-static void tqi_decode_mb(MpegEncContext *s, DCTELEM (*block)[64])
+static int tqi_decode_mb(MpegEncContext *s, DCTELEM (*block)[64])
 {
     int n;
     s->dsp.clear_blocks(block[0]);
     for (n=0; n<6; n++)
-        ff_mpeg1_decode_block_intra(s, block[n], n);
+        if(ff_mpeg1_decode_block_intra(s, block[n], n)<0)
+            return -1;
+
+    return 0;
 }
 
 static inline void tqi_idct_put(TqiContext *t, DCTELEM (*block)[64])
@@ -134,7 +137,8 @@ static int tqi_decode_frame(AVCodecContext *avctx,
     for (s->mb_y=0; s->mb_y<(avctx->height+15)/16; s->mb_y++)
     for (s->mb_x=0; s->mb_x<(avctx->width+15)/16; s->mb_x++)
     {
-        tqi_decode_mb(s, t->block);
+        if(tqi_decode_mb(s, t->block) < 0)
+            break;
         tqi_idct_put(t, t->block);
     }
 



More information about the ffmpeg-cvslog mailing list