aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-05-16 03:02:57 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-05-16 03:13:27 +0200
commit1fb46858c2498c67ae2d6775f7da29732e88fb8a (patch)
tree8e526fe97fa8b5e0fd579377a4d0943133093cca /libavcodec
parenta071c0b515e5935b4e2d09899303f6d3c9fb158b (diff)
downloadffmpeg-1fb46858c2498c67ae2d6775f7da29732e88fb8a.tar.gz
avcodec/cavs: prevent out of array read
The used value should not matter as long as its within the array as it is multiplied by 0 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/cavs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/cavs.c b/libavcodec/cavs.c
index c5313eb19c..888f38ba68 100644
--- a/libavcodec/cavs.c
+++ b/libavcodec/cavs.c
@@ -525,7 +525,7 @@ void ff_cavs_inter(AVSContext *h, enum cavs_mb mb_type)
static inline void scale_mv(AVSContext *h, int *d_x, int *d_y,
cavs_vector *src, int distp)
{
- int den = h->scale_den[src->ref];
+ int den = h->scale_den[FFMAX(src->ref, 0)];
*d_x = (src->x * distp * den + 256 + (src->x >> 31)) >> 9;
*d_y = (src->y * distp * den + 256 + (src->y >> 31)) >> 9;