[FFmpeg-devel] [PATCH] avformat/dhav: Add missed free for end_buffer

Derek Buitenhuis derek.buitenhuis at gmail.com
Fri Jun 6 16:44:50 EEST 2025


Accidentally left out of 36ec9217e6dca3432304c9d76078d9618247eb0f.

Found-by: Kacper Michajłow <kasper93 at gmail.com>
Signed-off-by: Derek Buitenhuis <derek.buitenhuis at gmail.com>
---
 libavformat/dhav.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavformat/dhav.c b/libavformat/dhav.c
index d9db775802..5a83a8aea9 100644
--- a/libavformat/dhav.c
+++ b/libavformat/dhav.c
@@ -280,6 +280,7 @@ static int64_t get_duration(AVFormatContext *s)
     }
 
     if (end_pos < 0 || end_pos + 16 > end_buffer_pos + end_buffer_size) {
+        av_freep(&end_buffer);
         avio_seek(s->pb, start_pos, SEEK_SET);
         return 0;
     }
@@ -288,6 +289,8 @@ static int64_t get_duration(AVFormatContext *s)
     get_timeinfo(date, &timeinfo);
     end = av_timegm(&timeinfo) * 1000LL;
 
+    av_freep(&end_buffer);
+
     avio_seek(s->pb, start_pos, SEEK_SET);
 
     return end - start;
-- 
2.49.0



More information about the ffmpeg-devel mailing list