avcodec/cavsdec: Fix undefined behavior from integer overflow
authorMichael Niedermayer <michael@niedermayer.cc>
Fri, 5 May 2017 01:24:40 +0000 (03:24 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Fri, 5 May 2017 02:25:07 +0000 (04:25 +0200)
Fixes: 1335/clusterfuzz-testcase-minimized-5566961566089216

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/cavsdec.c

index 6f4d6ac..4d3d2d7 100644 (file)
@@ -465,7 +465,7 @@ static inline void mv_pred_direct(AVSContext *h, cavs_vector *pmv_fw,
                                   cavs_vector *col_mv)
 {
     cavs_vector *pmv_bw = pmv_fw + MV_BWD_OFFS;
-    int den = h->direct_den[col_mv->ref];
+    unsigned den = h->direct_den[col_mv->ref];
     int m = FF_SIGNBIT(col_mv->x);
 
     pmv_fw->dist = h->dist[1];