[vlc-commits] [Git][videolan/vlc][master] demux: adaptive: skip PNG junk when probing

François Cartegnie (@fcartegnie) gitlab at videolan.org
Fri Aug 30 04:46:26 UTC 2024



François Cartegnie pushed to branch master at VideoLAN / VLC


Commits:
401d61d3 by François Cartegnie at 2024-08-30T04:27:36+00:00
demux: adaptive: skip PNG junk when probing

refs #28757

- - - - -


1 changed file:

- modules/demux/adaptive/StreamFormat.cpp


Changes:

=====================================
modules/demux/adaptive/StreamFormat.cpp
=====================================
@@ -128,6 +128,24 @@ StreamFormat::StreamFormat(const void *data_, size_t sz)
     type = Type::Unknown;
     const char moov[] = "ftypmoovmoofemsg";
 
+    /* Skip PNG junk */
+    if(sz >= 20 && !memcmp(data, "\x89PNG\x0D\x0A\x1A\x0A", 8))
+    {
+        data += 8;
+        sz -= 8;
+        while(sz >= 12)
+        {
+            uint32_t chunk = GetDWBE(data);
+            vlc_fourcc_t cktype = VLC_FOURCC(data[4], data[5], data[6], data[7]);
+            if(chunk > sz - 12)
+                break;
+            sz -= chunk + 12;
+            data += chunk + 12;
+            if(cktype == VLC_FOURCC('I','E','N','D'))
+                break;
+        }
+    }
+
     /* Skipped ID3 if any */
     while(sz > 10 && ID3TAG_IsTag(data, false))
     {



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/401d61d3ee34a723d83dee3158531bf96854d867

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/401d61d3ee34a723d83dee3158531bf96854d867
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list