You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-11-23 21:54:53 +02:00
swscale/ops_tmpl_int: fix signed integer related UB when shifting values
Fixes: src/libswscale/ops_tmpl_int.c:292:23: runtime error: left shift of 188 by 24 places cannot be represented in type 'int' src/libswscale/ops_tmpl_int.c:290:23: runtime error: left shift of 158 by 24 places cannot be represented in type 'int' src/libswscale/ops_tmpl_int.c:293:23: runtime error: left shift of 136 by 24 places cannot be represented in type 'int' src/libswscale/ops_tmpl_int.c:291:23: runtime error: left shift of 160 by 24 places cannot be represented in type 'int' Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
@@ -287,10 +287,10 @@ DECL_PATTERN(expand32)
|
|||||||
|
|
||||||
SWS_LOOP
|
SWS_LOOP
|
||||||
for (int i = 0; i < SWS_BLOCK_SIZE; i++) {
|
for (int i = 0; i < SWS_BLOCK_SIZE; i++) {
|
||||||
x32[i] = x[i] << 24 | x[i] << 16 | x[i] << 8 | x[i];
|
x32[i] = (uint32_t)x[i] << 24 | x[i] << 16 | x[i] << 8 | x[i];
|
||||||
y32[i] = y[i] << 24 | y[i] << 16 | y[i] << 8 | y[i];
|
y32[i] = (uint32_t)y[i] << 24 | y[i] << 16 | y[i] << 8 | y[i];
|
||||||
z32[i] = z[i] << 24 | z[i] << 16 | z[i] << 8 | z[i];
|
z32[i] = (uint32_t)z[i] << 24 | z[i] << 16 | z[i] << 8 | z[i];
|
||||||
w32[i] = w[i] << 24 | w[i] << 16 | w[i] << 8 | w[i];
|
w32[i] = (uint32_t)w[i] << 24 | w[i] << 16 | w[i] << 8 | w[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
CONTINUE(u32block_t, x32, y32, z32, w32);
|
CONTINUE(u32block_t, x32, y32, z32, w32);
|
||||||
|
|||||||
Reference in New Issue
Block a user