[FFmpeg-devel] [PATCH] avcodec/jpeg2000dec: Explicitly cast quad_width and quad_height to size_t
etemesicaleb at gmail.com
etemesicaleb at gmail.com
Tue Apr 25 21:24:29 EEST 2023
From: caleb <etemesicaleb at gmail.com>
Prevents un-necessary casts when calculating buf_size
---
libavcodec/jpeg2000htdec.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libavcodec/jpeg2000htdec.c b/libavcodec/jpeg2000htdec.c
index 51cd96e0f1..8907820806 100644
--- a/libavcodec/jpeg2000htdec.c
+++ b/libavcodec/jpeg2000htdec.c
@@ -592,8 +592,8 @@ static int jpeg2000_decode_ht_cleanup_segment(const Jpeg2000DecoderContext *s,
const uint16_t is_border_x = width % 2;
const uint16_t is_border_y = height % 2;
- const uint16_t quad_width = ff_jpeg2000_ceildivpow2(width, 1);
- const uint16_t quad_height = ff_jpeg2000_ceildivpow2(height, 1);
+ const size_t quad_width = ff_jpeg2000_ceildivpow2(width, 1);
+ const size_t quad_height = ff_jpeg2000_ceildivpow2(height, 1);
size_t buf_size = 4 * quad_width * quad_height;
--
2.39.2
More information about the ffmpeg-devel
mailing list