[Libav-user] libswscale assertion failure for grayf32 pixel format

atzur johannes.pihko at gmail.com
Sun Feb 4 04:13:39 EET 2024


the call
struct SwsContext* sws = sws_getContext(w, h, AV_PIX_FMT_GRAYF32LE, w,
h, AV_PIX_FMT_GRAYF32LE, ...);
seems to cause an assertion failure
Assertion c->srcBpc == 16 failed at libswscale/x86/swscale.c:533
on my amd64 machine with libswscale version 7.6.100.

when libswscale is compiled in release mode, no error occurs and the scaled
output only contains a 1/4 of each line in the source image, as if swscale
forgot that floats are 4 bytes, not 1. the issue appears to fix itself when
sws_getContext is given the source width * 4.

the same issue also exists for the pixel formats gbrpf32 and gbrapf32,
however neither of those give an assertion error in debug mode and instead
just output 1/4 of the source lines every time.

note that this ONLY happens when both source and destination dimensions and
pixel formats are the same. any conversion or scaling seems to work fine.

i believe this is a bug, but please let me know if i am doing anything
wrong instead.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://ffmpeg.org/pipermail/libav-user/attachments/20240204/7e4540a4/attachment.htm>


More information about the Libav-user mailing list