swscale/utils: improve check for float formats that will be converted to uint16_t

This was triggering an assertion in x86:
$ ./libswscale/tests/swscale -scaler none -backends unstable -src rgb24 -dst yaf32be
Assertion c->srcBpc == 16 failed at src/libswscale/x86/swscale.c:637
Aborted

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Ramiro Polla <ramiro.polla@gmail.com>
This commit is contained in:
Ramiro Polla
2026-05-26 02:04:11 +02:00
parent c7046f0ab3
commit 3977bca9f4
+1 -1
View File
@@ -1567,7 +1567,7 @@ av_cold int ff_sws_init_single_context(SwsContext *sws, SwsFilter *srcFilter,
}
// float will be converted to uint16_t
if ((srcFormat == AV_PIX_FMT_GRAYF32BE || srcFormat == AV_PIX_FMT_GRAYF32LE) &&
if (isFloat(srcFormat) && !isAnyRGB(srcFormat) &&
(!unscaled || unscaled && dstFormat != srcFormat && (srcFormat != AV_PIX_FMT_GRAYF32 ||
dstFormat != AV_PIX_FMT_GRAY8))){
c->srcBpc = 16;