mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2026-11-06 05:17:42 +00:00
avutil/imgutils: compute the line size of bitstream formats without overflow
Fixes: signed integer overflow Fixes: P0BVJKDC5JLx Found during the review of https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/24756 Signed integer overflow Replicated through UnModified FFmpeg with UBSAN
This commit is contained in:
1 parent
c61944093f
commit
bc74cf91f0
1 file changed
+1
-1
@@ -69,7 +69,7 @@ int image_get_linesize(int width, int plane,
|
||||
linesize = max_step * shifted_w;
|
||||
|
||||
if (desc->flags & AV_PIX_FMT_FLAG_BITSTREAM)
|
||||
linesize = (linesize + 7) >> 3;
|
||||
linesize = (linesize >> 3) + !!(linesize & 7);
|
||||
return linesize;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user