summaryrefslogtreecommitdiff
path: root/libavcodec/vp3.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-12-24 00:45:02 +0100
committerMichael Niedermayer <michaelni@gmx.at>2011-12-24 00:45:02 +0100
commitbba6f5b77f69e0b7fb00b3f346422715fc602f55 (patch)
tree3b1a17486c377e86daf4141e7900676fe6461332 /libavcodec/vp3.c
parentad9e0ed170234bc6c5660f96752777965081163e (diff)
parent8b94df0f2047e9728cb872adc9e64557b7a5152f (diff)
Merge remote-tracking branch 'qatar/master'
* qatar/master: vp3dec: Check coefficient index in vp3_dequant() svq1dec: call avcodec_set_dimensions() after dimensions changed. Prepare for 0.8_beta1 snapshot release threads: check defines before using them in automatic thread detection pthread: include sys/types.h before sys/sysctl.h 4xm: remove unused variables. h264: Fix a possible overread in decode_nal_units() allfilters: fix type of avfilter_vsrc_buffer. w32thread: call ResetEvent() in pthread_cond_broadcast(). Conflicts: Changelog RELEASE doc/RELEASE_NOTES libavcodec/pthread.c libavcodec/vp3.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/vp3.c')
-rw-r--r--libavcodec/vp3.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c
index 9e59dd8127..0137253e64 100644
--- a/libavcodec/vp3.c
+++ b/libavcodec/vp3.c
@@ -1363,9 +1363,9 @@ 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){
+ if (i > 63) {
av_log(s->avctx, AV_LOG_ERROR, "Coefficient index overflow\n");
- return -1;
+ return i;
}
block[perm[i]] = (token >> 9) * dequantizer[perm[i]];
i++;
@@ -1570,7 +1570,10 @@ static void render_slice(Vp3DecodeContext *s, int slice)
/* invert DCT and place (or add) in final output */
if (s->all_fragments[i].coding_method == MODE_INTRA) {
- vp3_dequant(s, s->all_fragments + i, plane, 0, block);
+ int index;
+ index = vp3_dequant(s, s->all_fragments + i, plane, 0, block);
+ if (index > 63)
+ continue;
if(s->avctx->idct_algo!=FF_IDCT_VP3)
block[0] += 128<<3;
s->dsp.idct_put(
@@ -1578,7 +1581,10 @@ static void render_slice(Vp3DecodeContext *s, int slice)
stride,
block);
} else {
- if (vp3_dequant(s, s->all_fragments + i, plane, 1, block)) {
+ int index = vp3_dequant(s, s->all_fragments + i, plane, 1, block);
+ if (index > 63)
+ continue;
+ if (index > 0) {
s->dsp.idct_add(
output_plane + first_pixel,
stride,