Skip to content

Commit d16a058

Browse files
committed
swscale/swscale: Do not crash on floats
Fixes: shift exponent 32 is too large for 32-bit type 'unsigned int' Fixes: division by zero Fixes: 391981061/clusterfuzz-testcase-minimized-ffmpeg_SWS_fuzzer-6691017763389440 Fixes: 392929028/clusterfuzz-testcase-minimized-ffmpeg_SWS_fuzzer-5142088307507200 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <[email protected]>
1 parent ce538ef commit d16a058

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libswscale/swscale.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -623,7 +623,7 @@ av_cold void ff_sws_init_range_convert(SwsInternal *c)
623623
{
624624
c->lumConvertRange = NULL;
625625
c->chrConvertRange = NULL;
626-
if (c->opts.src_range != c->opts.dst_range && !isAnyRGB(c->opts.dst_format)) {
626+
if (c->opts.src_range != c->opts.dst_range && !isAnyRGB(c->opts.dst_format) && c->dstBpc < 32) {
627627
init_range_convert_constants(c);
628628
if (c->dstBpc <= 14) {
629629
if (c->opts.src_range) {

0 commit comments

Comments
 (0)