asfpacket: fix 0.11 ported payload extraction

... to cater for not necessarily offset == size - cur_pos,
as size may have been adjusted due to padding.

Fixes #667567.
This commit is contained in:
Mark Nauwelaerts 2012-01-13 15:55:15 +01:00
parent 86313742d4
commit 0bc76c0d03
2 changed files with 5 additions and 1 deletions

View file

@ -77,7 +77,8 @@ asf_packet_create_payload_buffer (AsfPacket * packet, const guint8 ** p_data,
g_assert (payload_len <= *p_size);
off = (guint) (gst_buffer_get_size (packet->buf) - *p_size);
off = (guint) (*p_data - packet->bdata);
g_assert (off < gst_buffer_get_size (packet->buf));
*p_data += payload_len;
*p_size -= payload_len;
@ -484,6 +485,8 @@ gst_asf_demux_parse_packet (GstASFDemux * demux, GstBuffer * buf)
goto short_packet;
packet.buf = buf;
/* evidently transient */
packet.bdata = data;
ec_flags = GST_READ_UINT8 (data);

View file

@ -46,6 +46,7 @@ typedef struct {
typedef struct {
GstBuffer *buf;
const guint8 *bdata;
guint length; /* packet length (unused) */
guint padding; /* length of padding at end of packet */
guint sequence; /* sequence (unused) */