diff options
Diffstat (limited to 'libavcodec/vcr1.c')
-rw-r--r-- | libavcodec/vcr1.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/libavcodec/vcr1.c b/libavcodec/vcr1.c index c4b817e..60bfcce 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 */ @@ -37,6 +37,10 @@ static av_cold int vcr1_decode_init(AVCodecContext *avctx) { avctx->pix_fmt = AV_PIX_FMT_YUV410P; + if (avctx->width % 8 || avctx->height%4) { + avpriv_request_sample(avctx, "odd dimensions support"); + return AVERROR_PATCHWELCOME; + } return 0; } @@ -50,10 +54,13 @@ static int vcr1_decode_frame(AVCodecContext *avctx, void *data, const uint8_t *bytestream = buf; int i, x, y, ret; - if ((ret = ff_get_buffer(avctx, p, 0)) < 0) { - av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); - return ret; + 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); } + + if ((ret = ff_get_buffer(avctx, p, 0)) < 0) + return ret; p->pict_type = AV_PICTURE_TYPE_I; p->key_frame = 1; |