Hi,

Down-casting to a signed type (here, int16_t) is implementation-defined. And 
while normal compilers do the expected thing, with modulo-2^n complement, 
sanitizers tend to dislike it.

AFAIK, the clean solution is via an union whence you assign the uint16_t 
member, and then read the int16_t member. Fortunately, GCC and LLVM are able to 
optimise that construct back to a single sign-extension.

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

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

Reply via email to