tsmux: Fill padding packets with stuffing bytes
authorJan Alexander Steffens (heftig) <jan.steffens@ltnglobal.com>
Mon, 16 Oct 2023 13:31:04 +0000 (15:31 +0200)
committerTim-Philipp Müller <tim@centricular.com>
Thu, 19 Oct 2023 22:22:33 +0000 (23:22 +0100)
Instead of leaving it uncleared, emitting probably old packet data but
potentially also random or sensitive application data.

Also fix the mapping mode.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5513>

subprojects/gst-plugins-bad/gst/mpegtsmux/tsmux/tsmux.c

index e2b994f..95857ec 100644 (file)
@@ -1539,7 +1539,8 @@ pad_stream (TsMux * mux, TsMuxStream * stream, gint64 cur_ts)
         goto done;
       }
 
-      gst_buffer_map (buf, &map, GST_MAP_READ);
+      gst_buffer_map (buf, &map, GST_MAP_WRITE);
+      memset (map.data, 0xFF, map.size);
 
       if ((new_pcr =
               write_new_pcr (mux, stream, get_current_pcr (mux,