aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/cook.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-03-11 01:12:52 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-03-11 01:12:52 +0100
commitc3c2db49a7b10d0b57594332ee3c2cf4aa7552f2 (patch)
tree917b2763af34e1b6ded7184a23a28ee1b6346e8b /libavcodec/cook.c
parent6cb89df84596af0939a00496b381bcaa013ba929 (diff)
parent442c3a8cb1785d74f8e2d7ab35b1862b7088436b (diff)
downloadffmpeg-c3c2db49a7b10d0b57594332ee3c2cf4aa7552f2.tar.gz
Merge remote-tracking branch 'qatar/master'
* qatar/master: cook: expand dither_tab[], and make sure indexes into it don't overflow. xxan: reindent xan_unpack_luma(). xxan: protect against chroma LUT overreads. xxan: convert to bytestream2 API. xxan: don't read before start of buffer in av_memcpy_backptr(). vp8: convert mbedge loopfilter x86 assembly to use named arguments. vp8: convert inner loopfilter x86 assembly to use named arguments. Conflicts: libavcodec/xxan.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/cook.c')
-rw-r--r--libavcodec/cook.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libavcodec/cook.c b/libavcodec/cook.c
index db4245c236..775cff5b91 100644
--- a/libavcodec/cook.c
+++ b/libavcodec/cook.c
@@ -514,7 +514,11 @@ static inline void expand_category(COOKContext *q, int *category,
{
int i;
for (i = 0; i < q->num_vectors; i++)
- ++category[category_index[i]];
+ {
+ int idx = category_index[i];
+ if (++category[idx] >= FF_ARRAY_ELEMS(dither_tab))
+ --category[idx];
+ }
}
/**