demux: mkv: read data from KaxBlockAdditions as const
authorSteve Lhomme <robux4@ycbcr.xyz>
Sun, 10 Nov 2024 09:32:44 +0000 (10:32 +0100)
committerSebastian Ramacher <sramacher@debian.org>
Tue, 14 Jan 2025 22:09:47 +0000 (23:09 +0100)
We should not be able to modify what we read.

(cherry picked from commit c03249a02c2d1aa529c7c9a6de7545305b567860) (edited)
edited:
- 3.0 doesn't support VPx alpha

Gbp-Pq: Name 0101-demux-mkv-read-data-from-KaxBlockAdditions-as-const.patch

modules/demux/mkv/mkv.cpp
modules/demux/mkv/mkv.hpp

index cce9e3400270c52cde7eb0478c7e45d4315bc90d..c55af78bab63f7190f25294b372401f307044259 100644 (file)
@@ -488,7 +488,7 @@ static int Seek( demux_t *p_demux, vlc_tick_t i_mk_date, double f_percent, virtu
 
 /* Needed by matroska_segment::Seek() and Seek */
 void BlockDecode( demux_t *p_demux, KaxBlock *block, KaxSimpleBlock *simpleblock,
-                  KaxBlockAdditions *additions,
+                  const KaxBlockAdditions *additions,
                   vlc_tick_t i_pts, int64_t i_duration, bool b_key_picture,
                   bool b_discardable_picture )
 {
@@ -613,10 +613,10 @@ void BlockDecode( demux_t *p_demux, KaxBlock *block, KaxSimpleBlock *simpleblock
                 size_t i_addition = 0;
                 if(additions)
                 {
-                    KaxBlockMore *blockmore = FindChild<KaxBlockMore>(*additions);
+                    auto blockmore = FindChild<const KaxBlockMore>(*additions);
                     if(blockmore)
                     {
-                        KaxBlockAdditional *addition = FindChild<KaxBlockAdditional>(*blockmore);
+                        auto addition = FindChild<const KaxBlockAdditional>(*blockmore);
                         if(addition)
                         {
                             i_addition = static_cast<std::string::size_type>(addition->GetSize());
index 2ea8035f2d7002bf5cebe3890dda6922819cfc16..2a8ad5e9bf44696657fd7fd577dc4d21239f8f7f 100644 (file)
@@ -134,7 +134,7 @@ Type * FindNextChild(const EbmlMaster & Master, const Type & PastElt)
 using namespace LIBMATROSKA_NAMESPACE;
 
 void BlockDecode( demux_t *p_demux, KaxBlock *block, KaxSimpleBlock *simpleblock,
-                  KaxBlockAdditions *additions,
+                  const KaxBlockAdditions *additions,
                   vlc_tick_t i_pts, vlc_tick_t i_duration, bool b_key_picture,
                   bool b_discardable_picture );