From: Niklas Haas <ffmpeg@haasn.xyz>
To: ffmpeg-devel@ffmpeg.org
Cc: Niklas Haas <git@haasn.dev>
Subject: [FFmpeg-devel] [PATCH 1/2] swscale: fix gray -> grayf32 SIGFPE
Date: Sun, 16 Mar 2025 13:52:23 +0100
Message-ID: <20250316125224.7616-1-ffmpeg@haasn.xyz> (raw)
From: Niklas Haas <git@haasn.dev>
swscale internals don't distinguish between 16-bit and higher bit depth
output formats internally when it comes to the choice of intermediate
representation.
Clamping this value both prevents a SIGFPE and also aligns the check
with reality.
---
libswscale/swscale.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libswscale/swscale.c b/libswscale/swscale.c
index 98f94d029f..65ed654ebd 100644
--- a/libswscale/swscale.c
+++ b/libswscale/swscale.c
@@ -586,7 +586,7 @@ static void solve_range_convert(uint16_t src_min, uint16_t src_max,
static void init_range_convert_constants(SwsInternal *c)
{
- const int bit_depth = c->dstBpc ? c->dstBpc : 8;
+ const int bit_depth = c->dstBpc ? FFMIN(c->dstBpc, 16) : 8;
const int src_bits = bit_depth <= 14 ? 15 : 19;
const int src_shift = src_bits - bit_depth;
const int mult_shift = bit_depth <= 14 ? 14 : 18;
--
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".
next reply other threads:[~2025-03-16 12:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-16 12:52 Niklas Haas [this message]
2025-03-16 12:52 ` [FFmpeg-devel] [PATCH 2/2] swscale/swscale_unscaled: avoid nv12 <-> nv21 bug Niklas Haas
2025-03-16 15:02 ` James Almer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250316125224.7616-1-ffmpeg@haasn.xyz \
--to=ffmpeg@haasn.xyz \
--cc=ffmpeg-devel@ffmpeg.org \
--cc=git@haasn.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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