diff options
Diffstat (limited to 'libavcodec/vcr1.c')
-rw-r--r-- | libavcodec/vcr1.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/libavcodec/vcr1.c b/libavcodec/vcr1.c index df5088c9b8..2a4a090885 100644 --- a/libavcodec/vcr1.c +++ b/libavcodec/vcr1.c @@ -2,20 +2,20 @@ * ATI VCR1 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 */ @@ -39,6 +39,7 @@ static av_cold int vcr1_common_init(AVCodecContext *avctx) VCR1Context *const a = avctx->priv_data; avctx->coded_frame = &a->picture; + avcodec_get_frame_defaults(&a->picture); return 0; } @@ -76,6 +77,11 @@ static int vcr1_decode_frame(AVCodecContext *avctx, void *data, if (p->data[0]) avctx->release_buffer(avctx, p); + if(buf_size < 16 + avctx->height + avctx->width*avctx->height*5/8){ + av_log(avctx, AV_LOG_ERROR, "Insufficient input data.\n"); + return AVERROR(EINVAL); + } + p->reference = 0; if (avctx->get_buffer(avctx, p) < 0) { av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); |