[FFmpeg-devel] [PATCH] lavf/mov: avoid leaks with multiple dv-audio streams

Anton Khirnov anton at khirnov.net
Wed Aug 31 05:45:15 EEST 2022


---
 libavformat/mov.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index a2b429e52f..f433746192 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -2430,6 +2430,11 @@ static int mov_finalize_stsd_codec(MOVContext *c, AVIOContext *pb,
     switch (st->codecpar->codec_id) {
 #if CONFIG_DV_DEMUXER
     case AV_CODEC_ID_DVAUDIO:
+        if (c->dv_fctx) {
+            avpriv_request_sample(c->fc, "multiple DV audio streams");
+            return AVERROR(ENOSYS);
+        }
+
         c->dv_fctx = avformat_alloc_context();
         if (!c->dv_fctx) {
             av_log(c->fc, AV_LOG_ERROR, "dv demux context alloc error\n");
-- 
2.35.1



More information about the ffmpeg-devel mailing list