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:
Tim-Philipp Müller 2007-05-01 11:10:31 +00:00
parent 279b2b0290
commit c2784b4ca8
2 changed files with 24 additions and 5 deletions

View file

@ -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> 2007-05-01 Tim-Philipp Müller <tim at centricular dot net>
* gst/asfdemux/asfpacket.c: (gst_asf_payload_queue_for_stream): * gst/asfdemux/asfpacket.c: (gst_asf_payload_queue_for_stream):

View file

@ -357,13 +357,15 @@ gst_asf_demux_parse_payload (GstASFDemux * demux, AsfPacket * packet,
return FALSE; return FALSE;
} }
payload.buf = asf_packet_create_payload_buffer (packet, if (sub_payload_len > 0) {
&payload_data, &payload_len, sub_payload_len); payload.buf = asf_packet_create_payload_buffer (packet,
&payload_data, &payload_len, sub_payload_len);
payload.ts = ts; payload.ts = ts;
payload.duration = ts_delta; 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; ts += ts_delta;
} }
@ -453,6 +455,13 @@ gst_asf_demux_parse_packet (GstASFDemux * demux, GstBuffer * buf)
size -= packet.padding; 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) { if (has_multiple_payloads) {
guint i, num, lentype; guint i, num, lentype;