summaryrefslogtreecommitdiff
path: root/libavcodec/vp3.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec/vp3.c')
-rw-r--r--libavcodec/vp3.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c
index 6e04b7b01b..a6a3109dba 100644
--- a/libavcodec/vp3.c
+++ b/libavcodec/vp3.c
@@ -1,20 +1,20 @@
/*
* Copyright (C) 2003-2004 the ffmpeg project
*
- * 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
*/
@@ -1309,6 +1309,10 @@ static inline int vp3_dequant(Vp3DecodeContext *s, Vp3Fragment *frag,
case 1: // zero run
s->dct_tokens[plane][i]++;
i += (token >> 2) & 0x7f;
+ if(i>63){
+ av_log(s->avctx, AV_LOG_ERROR, "Coefficient index overflow\n");
+ return -1;
+ }
block[perm[i]] = (token >> 9) * dequantizer[perm[i]];
i++;
break;
@@ -1893,6 +1897,7 @@ static int vp3_decode_frame(AVCodecContext *avctx,
s->current_frame.reference = 3;
s->current_frame.pict_type = s->keyframe ? AV_PICTURE_TYPE_I : AV_PICTURE_TYPE_P;
+ s->current_frame.key_frame = s->keyframe;
if (ff_thread_get_buffer(avctx, &s->current_frame) < 0) {
av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed\n");
goto error;
@@ -1995,6 +2000,8 @@ error:
return -1;
}
+static void vp3_decode_flush(AVCodecContext *avctx);
+
static av_cold int vp3_decode_end(AVCodecContext *avctx)
{
Vp3DecodeContext *s = avctx->priv_data;