ffmpeg | branch: master | Thierry Foucu <[email protected]> | Mon May 11 
09:35:00 2020 -0700| [1187cbf0ffd7a74f9055def89ff88d5e36a9dbcd] | committer: 
Michael Niedermayer

avformat/mov: Read the QT Metadata Keys only once

If you have a file with multiple Metadata Keys, the second time you parse
the keys, you will re-alloc c->meta_keys without freeing the old one.
This change will avoid parsing all the consecutive Metadata keys.

Reviewed-by: Derek Buitenhuis <[email protected]>
Signed-off-by: Michael Niedermayer <[email protected]>

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

 libavformat/mov.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 93648994eb..6490022b1d 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -7026,7 +7026,8 @@ static int mov_read_default(MOVContext *c, AVIOContext 
*pb, MOVAtom atom)
         // 
https://developer.apple.com/library/mac/documentation/QuickTime/QTFF/Metadata/Metadata.html
         if (!parse && c->found_hdlr_mdta &&
             atom.type == MKTAG('m','e','t','a') &&
-            a.type == MKTAG('k','e','y','s')) {
+            a.type == MKTAG('k','e','y','s') &&
+            c->meta_keys_count == 0) {
             parse = mov_read_keys;
         }
 

_______________________________________________
ffmpeg-cvslog mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".

Reply via email to