Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH 1/3] swscale/swscale: Do not crash on floats
@ 2025-02-04  2:58 Michael Niedermayer
  2025-02-04  2:58 ` [FFmpeg-devel] [PATCH 2/3] swscale/output: Fix integer overflow in yuv2gbrp_full_X_c() Michael Niedermayer
  2025-02-04  2:58 ` [FFmpeg-devel] [PATCH 3/3] avcodec/osq: avoid undefined negation Michael Niedermayer
  0 siblings, 2 replies; 5+ messages in thread
From: Michael Niedermayer @ 2025-02-04  2:58 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

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@niedermayer.cc>
---
 libswscale/swscale.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libswscale/swscale.c b/libswscale/swscale.c
index 98f94d029fb..38b1e198239 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) {
-- 
2.48.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-02-05 18:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-02-04  2:58 [FFmpeg-devel] [PATCH 1/3] swscale/swscale: Do not crash on floats Michael Niedermayer
2025-02-04  2:58 ` [FFmpeg-devel] [PATCH 2/3] swscale/output: Fix integer overflow in yuv2gbrp_full_X_c() Michael Niedermayer
2025-02-04  2:58 ` [FFmpeg-devel] [PATCH 3/3] avcodec/osq: avoid undefined negation Michael Niedermayer
2025-02-04  3:16   ` James Almer
2025-02-05 18:46     ` Michael Niedermayer

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git