mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-23 10:11:08 +00:00
gst/asfdemux/asfpacket.c: If packet size is specified within the packet and smaller than the actual packet size, don'...
Original commit message from CVS: * gst/asfdemux/asfpacket.c: (gst_asf_demux_parse_payload), (gst_asf_demux_parse_packet): If packet size is specified within the packet and smaller than the actual packet size, don't parse beyond the size specified in the packet (this makes us parse some cases of packets with single compressed payloads cleanly, see e.g stream from #431318). Also add a sanity check when parsing compressed single payloads.
This commit is contained in:
parent
279b2b0290
commit
c2784b4ca8
2 changed files with 24 additions and 5 deletions
10
ChangeLog
10
ChangeLog
|
@ -1,3 +1,13 @@
|
|||
2007-05-01 Tim-Philipp Müller <tim at centricular dot net>
|
||||
|
||||
* gst/asfdemux/asfpacket.c: (gst_asf_demux_parse_payload),
|
||||
(gst_asf_demux_parse_packet):
|
||||
If packet size is specified within the packet and smaller than
|
||||
the actual packet size, don't parse beyond the size specified in
|
||||
the packet (this makes us parse some cases of packets with single
|
||||
compressed payloads cleanly, see e.g stream from #431318). Also
|
||||
add a sanity check when parsing compressed single payloads.
|
||||
|
||||
2007-05-01 Tim-Philipp Müller <tim at centricular dot net>
|
||||
|
||||
* gst/asfdemux/asfpacket.c: (gst_asf_payload_queue_for_stream):
|
||||
|
|
|
@ -357,13 +357,15 @@ gst_asf_demux_parse_payload (GstASFDemux * demux, AsfPacket * packet,
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
payload.buf = asf_packet_create_payload_buffer (packet,
|
||||
&payload_data, &payload_len, sub_payload_len);
|
||||
if (sub_payload_len > 0) {
|
||||
payload.buf = asf_packet_create_payload_buffer (packet,
|
||||
&payload_data, &payload_len, sub_payload_len);
|
||||
|
||||
payload.ts = ts;
|
||||
payload.duration = ts_delta;
|
||||
payload.ts = ts;
|
||||
payload.duration = ts_delta;
|
||||
|
||||
gst_asf_payload_queue_for_stream (demux, &payload, stream);
|
||||
gst_asf_payload_queue_for_stream (demux, &payload, stream);
|
||||
}
|
||||
|
||||
ts += ts_delta;
|
||||
}
|
||||
|
@ -453,6 +455,13 @@ gst_asf_demux_parse_packet (GstASFDemux * demux, GstBuffer * buf)
|
|||
|
||||
size -= packet.padding;
|
||||
|
||||
/* adjust available size for parsing if there's less actual packet data for
|
||||
* parsing than there is data in bytes (for sample see bug 431318) */
|
||||
if (packet.length != 0 && packet.length < demux->packet_size) {
|
||||
GST_LOG_OBJECT (demux, "shortened packet, adjusting available data size");
|
||||
size -= (demux->packet_size - packet.length);
|
||||
}
|
||||
|
||||
if (has_multiple_payloads) {
|
||||
guint i, num, lentype;
|
||||
|
||||
|
|
Loading…
Reference in a new issue