diff mbox series

[FFmpeg-devel,07/22] avformat/mov: Use 64bit for str_size

Message ID 20240711233417.1896879-7-michael@niedermayer.cc
State New
Headers show
Series [FFmpeg-devel,01/22] avformat/asfdec_o: Check size of index object | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Michael Niedermayer July 11, 2024, 11:34 p.m. UTC
We assign a 64bit variable to it before checking

Fixes: CID1604544 Overflowed integer argument

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavformat/mov.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/libavformat/mov.c b/libavformat/mov.c
index d862434d256..7c33c4477dd 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -333,7 +333,8 @@  static int mov_read_udta_string(MOVContext *c, AVIOContext *pb, MOVAtom atom)
     char *str = NULL;
     const char *key = NULL;
     uint16_t langcode = 0;
-    uint32_t data_type = 0, str_size, str_size_alloc;
+    uint32_t data_type = 0, str_size_alloc;
+    uint64_t str_size;
     int (*parse)(MOVContext*, AVIOContext*, unsigned, const char*) = NULL;
     int raw = 0;
     int num = 0;