diff options
Diffstat (limited to 'libavcodec/adx.c')
-rw-r--r-- | libavcodec/adx.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/libavcodec/adx.c b/libavcodec/adx.c index 6335865..94bc386 100644 --- a/libavcodec/adx.c +++ b/libavcodec/adx.c @@ -1,20 +1,20 @@ /* * Copyright (c) 2011 Justin Ruggles * - * 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 */ @@ -47,6 +47,11 @@ int avpriv_adx_decode_header(AVCodecContext *avctx, const uint8_t *buf, return AVERROR_INVALIDDATA; offset = AV_RB16(buf + 2) + 4; + if (offset < 6) { + av_log(avctx, AV_LOG_ERROR, "offset is prior data\n"); + return AVERROR_INVALIDDATA; + } + /* if copyright string is within the provided data, validate it */ if (bufsize >= offset && memcmp(buf + offset - 6, "(c)CRI", 6)) return AVERROR_INVALIDDATA; |