[FFmpeg-devel] [PATCH] avformat/wavenc: use strtoull for UMID conversion

Gyan Doshi ffmpeg at gyani.pro
Mon Jan 29 07:00:07 EET 2024


Existing use of strtoll can lead to ERANGE errors leading to incorrect
storage of UMID.
---
 libavformat/wavenc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/wavenc.c b/libavformat/wavenc.c
index 82acb9ef0f..a41f40b449 100644
--- a/libavformat/wavenc.c
+++ b/libavformat/wavenc.c
@@ -129,7 +129,7 @@ static void bwf_write_bext_chunk(AVFormatContext *s)
 
         for (i = 0; i < len/16; i++) {
             memcpy(umidpart_str, tmp_tag->value + 2 + (i*16), 16);
-            umidpart = strtoll(umidpart_str, NULL, 16);
+            umidpart = strtoull(umidpart_str, NULL, 16);
             avio_wb64(s->pb, umidpart);
         }
         ffio_fill(s->pb, 0, 64 - i*8);
-- 
2.39.1



More information about the ffmpeg-devel mailing list