diff mbox series

[FFmpeg-devel,1/8] avfilter/vf_elbg: Use unsigned for shifting into the top bit

Message ID 20240708222410.773456-1-michael@niedermayer.cc
State New
Headers show
Series [FFmpeg-devel,1/8] avfilter/vf_elbg: Use unsigned for shifting into the top bit | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 fail Make fate failed
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Michael Niedermayer July 8, 2024, 10:24 p.m. UTC
Fixes: part of CID1355110 Overflowed constant

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavfilter/vf_elbg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Michael Niedermayer July 21, 2024, 2:35 p.m. UTC | #1
On Tue, Jul 09, 2024 at 12:24:03AM +0200, Michael Niedermayer wrote:
> Fixes: part of CID1355110 Overflowed constant
> 
> Sponsored-by: Sovereign Tech Fund
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavfilter/vf_elbg.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

will apply 1-7 (not 8)

[...]
diff mbox series

Patch

diff --git a/libavfilter/vf_elbg.c b/libavfilter/vf_elbg.c
index 732a2c8abfb..dd22da07b6b 100644
--- a/libavfilter/vf_elbg.c
+++ b/libavfilter/vf_elbg.c
@@ -195,7 +195,7 @@  static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
         p0 = (uint8_t *)out->data[0];
 
         for (i = 0; i < elbg->codebook_length; i++) {
-            const int al =  elbg->use_alpha ? elbg->codebook[i*4+3] : 0xff;
+            const unsigned al =  elbg->use_alpha ? elbg->codebook[i*4+3] : 0xff;
             pal[i] =  al                    << 24  |
                      (elbg->codebook[i*4+2] << 16) |
                      (elbg->codebook[i*4+1] <<  8) |