[FFmpeg-cvslog] avformat/dhav: Don't truncate return value of avio_skip()

Andreas Rheinhardt git at videolan.org
Tue May 10 07:48:58 EEST 2022


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Sat May  7 08:25:24 2022 +0200| [3417379d5e85c026e6eda447ea7fcd3ccccead4a] | committer: Andreas Rheinhardt

avformat/dhav: Don't truncate return value of avio_skip()

Fixes demuxing files bigger than INT_MAX.

Reported-by: jenster
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>

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

 libavformat/dhav.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavformat/dhav.c b/libavformat/dhav.c
index 60aab8cabd..9d26efe8fc 100644
--- a/libavformat/dhav.c
+++ b/libavformat/dhav.c
@@ -78,10 +78,11 @@ static const uint32_t sample_rates[] = {
 static int parse_ext(AVFormatContext *s, int length)
 {
     DHAVContext *dhav = s->priv_data;
-    int index, ret = 0;
+    int64_t ret = 0;
 
     while (length > 0) {
         int type = avio_r8(s->pb);
+        int index;
 
         switch (type) {
         case 0x80:
@@ -168,8 +169,7 @@ static int read_chunk(AVFormatContext *s)
 {
     DHAVContext *dhav = s->priv_data;
     int frame_length, ext_length;
-    int64_t start, end;
-    int ret;
+    int64_t start, end, ret;
 
     if (avio_feof(s->pb))
         return AVERROR_EOF;



More information about the ffmpeg-cvslog mailing list