mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-08 13:22:53 +02:00
avcodec/cavs: Check updated MV
Fixes: runtime error: signed integer overflow: 251 + 2147483647 cannot be represented in type 'int'
Fixes: 1438/clusterfuzz-testcase-minimized-4917542646710272
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 5871adc90f
)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
a98d82b13d
commit
7bbd92f69d
@ -614,8 +614,15 @@ void ff_cavs_mv(AVSContext *h, enum cavs_mv_loc nP, enum cavs_mv_loc nC,
|
||||
mv_pred_median(h, mvP, mvA, mvB, mvC);
|
||||
|
||||
if (mode < MV_PRED_PSKIP) {
|
||||
mvP->x += get_se_golomb(&h->gb);
|
||||
mvP->y += get_se_golomb(&h->gb);
|
||||
int mx = get_se_golomb(&h->gb) + (unsigned)mvP->x;
|
||||
int my = get_se_golomb(&h->gb) + (unsigned)mvP->y;
|
||||
|
||||
if (mx != (int16_t)mx || my != (int16_t)my) {
|
||||
av_log(h->avctx, AV_LOG_ERROR, "MV %d %d out of supported range\n", mx, my);
|
||||
} else {
|
||||
mvP->x = mx;
|
||||
mvP->y = my;
|
||||
}
|
||||
}
|
||||
set_mvs(mvP, size);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user