diff options
Diffstat (limited to 'libavcodec/mdec.c')
-rw-r--r-- | libavcodec/mdec.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/libavcodec/mdec.c b/libavcodec/mdec.c index b9ffca6..ea47822 100644 --- a/libavcodec/mdec.c +++ b/libavcodec/mdec.c @@ -4,20 +4,20 @@ * * based upon code from Sebastian Jedruszkiewicz <elf@frogger.rules.pl> * - * 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 Street, Fifth Floor, Boston, MA 02110-1301 USA */ @@ -121,7 +121,7 @@ static inline int mdec_decode_block_intra(MDECContext *a, int16_t *block, int n) static inline int decode_mb(MDECContext *a, int16_t block[6][64]) { int i, ret; - const int block_index[6] = { 5, 4, 0, 1, 2, 3 }; + static const int block_index[6] = { 5, 4, 0, 1, 2, 3 }; a->dsp.clear_blocks(block[0]); @@ -165,10 +165,8 @@ static int decode_frame(AVCodecContext *avctx, ThreadFrame frame = { .f = data }; int i, ret; - if ((ret = ff_thread_get_buffer(avctx, &frame, 0)) < 0) { - av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); + if ((ret = ff_thread_get_buffer(avctx, &frame, 0)) < 0) return ret; - } frame.f->pict_type = AV_PICTURE_TYPE_I; frame.f->key_frame = 1; @@ -179,7 +177,8 @@ static int decode_frame(AVCodecContext *avctx, a->bitstream_buffer[i] = buf[i + 1]; a->bitstream_buffer[i + 1] = buf[i]; } - init_get_bits(&a->gb, a->bitstream_buffer, buf_size * 8); + if ((ret = init_get_bits8(&a->gb, a->bitstream_buffer, buf_size)) < 0) + return ret; /* skip over 4 preamble bytes in stream (typically 0xXX 0xXX 0x00 0x38) */ skip_bits(&a->gb, 32); |