Commit 1fb46858 authored by Michael Niedermayer's avatar Michael Niedermayer

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: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent a071c0b5
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment