diff options
Diffstat (limited to 'libavcodec/asv1.c')
-rw-r--r-- | libavcodec/asv1.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/libavcodec/asv1.c b/libavcodec/asv1.c index 6c8bed3..702a59e 100644 --- a/libavcodec/asv1.c +++ b/libavcodec/asv1.c @@ -2,20 +2,20 @@ * ASUS V1/V2 codec * Copyright (c) 2003 Michael Niedermayer * - * 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 */ @@ -25,6 +25,7 @@ */ #include "avcodec.h" +#include "internal.h" #include "libavutil/common.h" #include "put_bits.h" #include "dsputil.h" @@ -471,12 +472,9 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, int size, ret; int mb_x, mb_y; - if (!pkt->data && - (ret = av_new_packet(pkt, a->mb_height*a->mb_width*MAX_MB_SIZE + - FF_MIN_BUFFER_SIZE)) < 0) { - av_log(avctx, AV_LOG_ERROR, "Error getting output packet.\n"); + if ((ret = ff_alloc_packet2(avctx, pkt, a->mb_height*a->mb_width*MAX_MB_SIZE + + FF_MIN_BUFFER_SIZE)) < 0) return ret; - } init_put_bits(&a->pb, pkt->data, pkt->size); @@ -555,8 +553,7 @@ static av_cold int decode_init(AVCodecContext *avctx){ ff_init_scantable(a->dsp.idct_permutation, &a->scantable, scantab); avctx->pix_fmt= PIX_FMT_YUV420P; - a->inv_qscale= avctx->extradata[0]; - if(a->inv_qscale == 0){ + if(avctx->extradata_size < 1 || (a->inv_qscale= avctx->extradata[0]) == 0){ av_log(avctx, AV_LOG_ERROR, "illegal qscale 0\n"); if(avctx->codec_id == CODEC_ID_ASV1) a->inv_qscale= 6; |