[FFmpeg-devel] [PATCH 3/7] avformat/ape: Use 64bit for final frame size

Michael Niedermayer michael at niedermayer.cc
Thu May 23 04:17:54 EEST 2024


Fixes: CID1505963 Unintentional integer overflow

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
---
 libavformat/ape.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/ape.c b/libavformat/ape.c
index c0e3e9f4fe6..f86ca5e894c 100644
--- a/libavformat/ape.c
+++ b/libavformat/ape.c
@@ -292,7 +292,7 @@ static int ape_read_header(AVFormatContext * s)
         final_size -= final_size & 3;
     }
     if (file_size <= 0 || final_size <= 0)
-        final_size = ape->finalframeblocks * 8;
+        final_size = ape->finalframeblocks * 8LL;
     ape->frames[ape->totalframes - 1].size = final_size;
 
     for (i = 0; i < ape->totalframes; i++) {
-- 
2.45.1



More information about the ffmpeg-devel mailing list