1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

tqi: Pass errors from the MB decoder

This silences some valgrind warnings.
CC: libav-stable@libav.org

Fixes second half of http://ffmpeg.org/trac/ffmpeg/ticket/794
Bug found by: Oana Stratulat

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
(cherry picked from commit f85334f58e)
This commit is contained in:
Michael Niedermayer 2011-12-19 04:13:37 +01:00 committed by Reinhard Tartler
parent 3f9d6e4239
commit 90290a5150

View File

@ -57,12 +57,15 @@ static av_cold int tqi_decode_init(AVCodecContext *avctx)
return 0; return 0;
} }
static void tqi_decode_mb(MpegEncContext *s, DCTELEM (*block)[64]) static int tqi_decode_mb(MpegEncContext *s, DCTELEM (*block)[64])
{ {
int n; int n;
s->dsp.clear_blocks(block[0]); s->dsp.clear_blocks(block[0]);
for (n=0; n<6; n++) 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]) static inline void tqi_idct_put(TqiContext *t, DCTELEM (*block)[64])
@ -135,7 +138,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_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++) 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); tqi_idct_put(t, t->block);
} }