[FFmpeg-cvslog] avformat/matroskadec: also validate the mapping when BlockAddIDType is 0

James Almer git at videolan.org
Sat Apr 8 21:32:21 EEST 2023


ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Sat Apr  8 14:59:40 2023 -0300| [82a14f360279ab252c2d17719ae72dd361f8277d] | committer: James Almer

avformat/matroskadec: also validate the mapping when BlockAddIDType is 0

Signed-off-by: James Almer <jamrial at gmail.com>

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

 libavformat/matroskadec.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index b3922ab8b0..6cccbcbe03 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -2389,16 +2389,18 @@ static int mkv_parse_block_addition_mappings(AVFormatContext *s, AVStream *st, M
 
     for (int i = 0; i < mappings_list->nb_elem; i++) {
         MatroskaBlockAdditionMapping *mapping = &mappings[i];
+        uint64_t type = mapping->type;
 
         switch (mapping->type) {
         case MATROSKA_BLOCK_ADD_ID_TYPE_DEFAULT:
             av_log(s, AV_LOG_DEBUG,
                    "Explicit block Addition Mapping type \"Use BlockAddIDValue\", value %"PRIu64","
                    " name \"%s\" found.\n", mapping->value, mapping->name ? mapping->name : "");
-            break;
+            type = MATROSKA_BLOCK_ADD_ID_TYPE_OPAQUE;
+            // fall-through
         case MATROSKA_BLOCK_ADD_ID_TYPE_OPAQUE:
         case MATROSKA_BLOCK_ADD_ID_TYPE_ITU_T_T35:
-            if (mapping->value != mapping->type) {
+            if (mapping->value != type) {
                 int strict = s->strict_std_compliance >= FF_COMPLIANCE_STRICT;
                 av_log(s, strict ? AV_LOG_ERROR : AV_LOG_WARNING,
                        "Invalid Block Addition Value 0x%"PRIx64" for Block Addition Mapping Type "



More information about the ffmpeg-cvslog mailing list