mirror of https://git.ffmpeg.org/ffmpeg.git
avformat/replaygain: avoid undefined / negative abs
Fixes: signed integer overflow: -2147483648 * 100000 cannot be represented in type 'int' Fixes: 52060/clusterfuzz-testcase-minimized-ffmpeg_dem_MP3_fuzzer-5131616708329472 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
b74f89caae
commit
2532b20b17
|
@ -60,7 +60,7 @@ static int32_t parse_value(const char *value, int32_t min)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (abs(db) > (INT32_MAX - mb) / 100000)
|
if (llabs(db) > (INT32_MAX - mb) / 100000)
|
||||||
return min;
|
return min;
|
||||||
|
|
||||||
return db * 100000 + sign * mb;
|
return db * 100000 + sign * mb;
|
||||||
|
|
Loading…
Reference in New Issue