ffmpeg | branch: master | Paul B Mahol <one...@gmail.com> | Fri Sep 16 17:58:36 
2022 +0200| [9c05f178a6a9672411e5f5149c1b04adb4e77b51] | committer: Paul B Mahol

avformat/ape: fix overflow in total_blocks

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9c05f178a6a9672411e5f5149c1b04adb4e77b51
---

 libavformat/ape.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavformat/ape.c b/libavformat/ape.c
index e694df7302..f904fde178 100644
--- a/libavformat/ape.c
+++ b/libavformat/ape.c
@@ -146,7 +146,7 @@ static int ape_read_header(AVFormatContext * s)
     AVStream *st;
     uint32_t tag;
     int i, ret;
-    int total_blocks;
+    int64_t total_blocks;
     int64_t final_size = 0;
     int64_t pts, file_size;
 
@@ -327,7 +327,7 @@ static int ape_read_header(AVFormatContext * s)
     if (!st)
         return AVERROR(ENOMEM);
 
-    total_blocks = (ape->totalframes == 0) ? 0 : ((ape->totalframes - 1) * 
ape->blocksperframe) + ape->finalframeblocks;
+    total_blocks = (ape->totalframes == 0) ? 0 : ((int64_t)(ape->totalframes - 
1) * ape->blocksperframe) + ape->finalframeblocks;
 
     st->codecpar->codec_type      = AVMEDIA_TYPE_AUDIO;
     st->codecpar->codec_id        = AV_CODEC_ID_APE;

_______________________________________________
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to