diff options
Diffstat (limited to 'libavcodec/eatqi.c')
-rw-r--r-- | libavcodec/eatqi.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/libavcodec/eatqi.c b/libavcodec/eatqi.c index 2d7da5a603..9e773bcb0e 100644 --- a/libavcodec/eatqi.c +++ b/libavcodec/eatqi.c @@ -2,20 +2,20 @@ * Electronic Arts TQI Video Decoder * Copyright (c) 2007-2009 Peter Ross <pross@xvid.org> * - * This file is part of Libav. + * This file is part of FFmpeg. * - * Libav is free software; you can redistribute it and/or + * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * - * Libav is distributed in the hope that it will be useful, + * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with Libav; if not, write to the Free Software + * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ @@ -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]) @@ -135,9 +138,11 @@ 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) + goto end; tqi_idct_put(t, t->block); } + end: *data_size = sizeof(AVFrame); *(AVFrame*)data = t->frame; |