[FFmpeg-devel] [PATCH] avformat/mov: Disallow more than one meta box for AVIF

Vignesh Venkatasubramanian vigneshv at google.com
Wed Oct 4 02:04:19 EEST 2023


This is not allowed per the spec.

Signed-off-by: Vignesh Venkatasubramanian <vigneshv at google.com>
---
 libavformat/mov.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 294c864fbd..a8f57f9281 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -4892,6 +4892,8 @@ static int avif_add_stream(MOVContext *c, int item_id)
 {
     MOVStreamContext *sc;
     AVStream *st;
+    if (c->fc->nb_streams)
+        return AVERROR_INVALIDDATA;
     int item_index = -1;
     for (int i = 0; i < c->avif_info_size; i++)
         if (c->avif_info[i].item_id == item_id) {
-- 
2.42.0.582.g8ccd20d70d-goog



More information about the ffmpeg-devel mailing list