Commit d8e153bfcd for ffmpeg
commit d8e153bfcdd7040a0c61d5e43270bbe8b488d482
Author: Michael Niedermayer <michael@niedermayer.cc>
Date: Sat Nov 7 22:08:08 2026 +0100
swscale/graph: double the field linesizes by multiplication
Fixes: left shift of negative value
Fixes: n2XAJMw9D94O
Found during the review of https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/25387
Found during the review of https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/24851
Left shift of a negative value Replicated through UnModified FFmpeg with UBSAN
diff --git a/libswscale/graph.c b/libswscale/graph.c
index d34d298901..98a04c7876 100644
--- a/libswscale/graph.c
+++ b/libswscale/graph.c
@@ -1026,7 +1026,7 @@ static void get_field(SwsGraph *graph, const SwsFormat *fmt,
/* Take only every second line */
for (int i = 0; i < 4; i++)
- frame->linesize[i] <<= 1;
+ frame->linesize[i] *= 2;
frame->height = (frame->height + (fmt->field == FIELD_TOP)) >> 1;
}