[FFmpeg-cvslog] swscale/swscale: Do not crash on floats
Michael Niedermayer
git at videolan.org
Thu Apr 10 04:13:15 EEST 2025
ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Tue Feb 4 03:58:43 2025 +0100| [d16a058dbc9974f5919da3315e8cb41f8e6102f0] | committer: Michael Niedermayer
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 <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d16a058dbc9974f5919da3315e8cb41f8e6102f0
---
libswscale/swscale.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libswscale/swscale.c b/libswscale/swscale.c
index 65ed654ebd..c3d64a67b8 100644
--- a/libswscale/swscale.c
+++ b/libswscale/swscale.c
@@ -623,7 +623,7 @@ av_cold void ff_sws_init_range_convert(SwsInternal *c)
{
c->lumConvertRange = NULL;
c->chrConvertRange = NULL;
- if (c->opts.src_range != c->opts.dst_range && !isAnyRGB(c->opts.dst_format)) {
+ if (c->opts.src_range != c->opts.dst_range && !isAnyRGB(c->opts.dst_format) && c->dstBpc < 32) {
init_range_convert_constants(c);
if (c->dstBpc <= 14) {
if (c->opts.src_range) {
More information about the ffmpeg-cvslog
mailing list