Skip to content

lib: avoid negating VLC_EGENERIC error code

Alaric Senat requested to merge asenat/vlc:libvlc-print-ub into master

VLC_EGENERIC is defined to INT_MIN and negating as a 32 bits integer is undefined behavior. Let's print a custom error message instead, as it will never be a valid errno value anyway.

Reported by UBSAN: ../../lib/core.c:72:9: runtime error: negation of -2147483648 cannot be represented in type 'int'; cast to an unsigned type to negate this value to itself

Edited by Alaric Senat

Merge request reports