[FFmpeg-devel] [PATCH 2/2] swscale/input: Use more unsigned intermediates

Michael Niedermayer michael at niedermayer.cc
Wed Nov 16 00:19:02 EET 2022


On Tue, Nov 15, 2022 at 11:16:57PM +0100, Michael Niedermayer wrote:
> Same principle as previous commit, with sufficiently huge rgb2yuv table
> values this produces wrong results and undefined behavior.
> The unsigned produces the same incorrect results. That is probably
> ok as these cases with huge values seem not to occur in any real
> use case.
> 
> There are more cases but someone is refactoring them, so i didnt yet change
> them.
> 
> Fixes: signed integer overflow
> Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> ---
>  libswscale/input.c | 24 ++++++++++++------------
>  1 file changed, 12 insertions(+), 12 deletions(-)

I can merge these 2 if people prefer

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Let us carefully observe those good qualities wherein our enemies excel us
and endeavor to excel them, by avoiding what is faulty, and imitating what
is excellent in them. -- Plutarch
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20221115/d7da4f40/attachment.sig>


More information about the ffmpeg-devel mailing list