You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
avcodec/amrwbdec: Fix 2 runtime errors: left shift of negative value -1
Fixes: 669/clusterfuzz-testcase-4847965409640448 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
@@ -292,7 +292,7 @@ static void decode_pitch_lag_low(int *lag_int, int *lag_frac, int pitch_index,
|
|||||||
if (subframe == 0 || (subframe == 2 && mode != MODE_6k60)) {
|
if (subframe == 0 || (subframe == 2 && mode != MODE_6k60)) {
|
||||||
if (pitch_index < 116) {
|
if (pitch_index < 116) {
|
||||||
*lag_int = (pitch_index + 69) >> 1;
|
*lag_int = (pitch_index + 69) >> 1;
|
||||||
*lag_frac = (pitch_index - (*lag_int << 1) + 68) << 1;
|
*lag_frac = (pitch_index - (*lag_int << 1) + 68) * 2;
|
||||||
} else {
|
} else {
|
||||||
*lag_int = pitch_index - 24;
|
*lag_int = pitch_index - 24;
|
||||||
*lag_frac = 0;
|
*lag_frac = 0;
|
||||||
@@ -302,7 +302,7 @@ static void decode_pitch_lag_low(int *lag_int, int *lag_frac, int pitch_index,
|
|||||||
AMRWB_P_DELAY_MIN, AMRWB_P_DELAY_MAX - 15);
|
AMRWB_P_DELAY_MIN, AMRWB_P_DELAY_MAX - 15);
|
||||||
} else {
|
} else {
|
||||||
*lag_int = (pitch_index + 1) >> 1;
|
*lag_int = (pitch_index + 1) >> 1;
|
||||||
*lag_frac = (pitch_index - (*lag_int << 1)) << 1;
|
*lag_frac = (pitch_index - (*lag_int << 1)) * 2;
|
||||||
*lag_int += *base_lag_int;
|
*lag_int += *base_lag_int;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user