You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
avcodec/jpeg2000: fix type of arguments of tag_tree_size
Fixes: out of array read Fixes: 36b8096fefab16c4c9326a508053e95c/signal_sigsegv_1d9ce18_3233_1a55196b018106dfabeace071a432d9e.r3d Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
@@ -38,11 +38,11 @@
|
||||
/* tag tree routines */
|
||||
|
||||
/* allocate the memory for tag tree */
|
||||
static int32_t tag_tree_size(uint16_t w, uint16_t h)
|
||||
static int32_t tag_tree_size(int w, int h)
|
||||
{
|
||||
uint32_t res = 0;
|
||||
int64_t res = 0;
|
||||
while (w > 1 || h > 1) {
|
||||
res += w * h;
|
||||
res += w * (int64_t)h;
|
||||
av_assert0(res + 1 < INT32_MAX);
|
||||
w = (w + 1) >> 1;
|
||||
h = (h + 1) >> 1;
|
||||
|
Reference in New Issue
Block a user