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>
This commit is contained in:
Michael Niedermayer 2014-05-16 03:02:57 +02:00
parent a071c0b515
commit 1fb46858c2

View File

@ -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;