diff mbox series

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

Message ID 20220831024515.16191-1-anton@khirnov.net
State Accepted
Commit 693c1e631c4957acd2fe9d9650d757fd8d3d1239
Headers show
Series [FFmpeg-devel] lavf/mov: avoid leaks with multiple dv-audio streams | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Anton Khirnov Aug. 31, 2022, 2:45 a.m. UTC
---
 libavformat/mov.c | 5 +++++
 1 file changed, 5 insertions(+)
diff mbox series

Patch

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");