diff mbox series

[FFmpeg-devel,2/3] avformat/mov: don't read key_size bytes twice in the keys atom

Message ID 20240402031800.7159-2-jamrial@gmail.com
State Accepted
Commit 5a06d3810e41134ee9c2941cc0b371da62b539db
Headers show
Series [FFmpeg-devel,1/3] avformat/mov: take into account the first eight bytes in the keys atom | 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

James Almer April 2, 2024, 3:17 a.m. UTC
We only support mdta as type, yet we were not skipping other types,
but rather reading key_size worth of bytes twice per entry.

Signed-off-by: James Almer <jamrial@gmail.com>
---
 libavformat/mov.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 3273e2e89b..a935ef7326 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -5049,6 +5049,7 @@  static int mov_read_keys(MOVContext *c, AVIOContext *pb, MOVAtom atom)
         key_size -= 8;
         if (type != MKTAG('m','d','t','a')) {
             avio_skip(pb, key_size);
+            continue;
         }
         c->meta_keys[i] = av_mallocz(key_size + 1);
         if (!c->meta_keys[i])