From 0a045837a5cba37eb0a5ff4de318aeea4f321903 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Fri, 8 Nov 2019 16:52:39 +0100 Subject: [PATCH] MP4 reader: skip cover art images of unknown type instead of assuming JPEG --- NEWS.md | 2 ++ src/input/r_qtmp4.cpp | 3 +++ 2 files changed, 5 insertions(+) diff --git a/NEWS.md b/NEWS.md index 34a1743e4..790012431 100644 --- a/NEWS.md +++ b/NEWS.md @@ -15,6 +15,8 @@ art images. This could cause file identification to fail when the cover art was located at the end of the MP4 file. Even if it succeeded, this meant too much data present in the attachment. Fixes #2650. +* mkvmerge: MP4 reader: covert art images with unknown image types will be + skipped instead of treated as JPEG images. ## Build system changes diff --git a/src/input/r_qtmp4.cpp b/src/input/r_qtmp4.cpp index 21a5cc3cd..b156d2910 100644 --- a/src/input/r_qtmp4.cpp +++ b/src/input/r_qtmp4.cpp @@ -1052,6 +1052,9 @@ qtmp4_reader_c::handle_covr_atom(qt_atom_t parent, try { auto type = m_in->read_uint32_be(); + if (!mtx::included_in(type, MP4ADT_BMP, MP4ADT_JPEG, MP4ADT_PNG)) + return; + m_in->skip(4); data_size -= 8;