summaryrefslogtreecommitdiff
path: root/gst
diff options
context:
space:
mode:
authorMark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>2012-01-13 15:55:15 +0100
committerMark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>2012-01-13 15:59:01 +0100
commit0bc76c0d038a2bac17d93caae0bfd00d8ca5bbc0 (patch)
tree08ec7db4ed5f5f4965f961b1d309d2474c196688 /gst
parent86313742d4c11c1ca8705de1265acb4cb8af39cf (diff)
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.
Diffstat (limited to 'gst')
-rw-r--r--gst/asfdemux/asfpacket.c5
-rw-r--r--gst/asfdemux/asfpacket.h1
2 files changed, 5 insertions, 1 deletions
diff --git a/gst/asfdemux/asfpacket.c b/gst/asfdemux/asfpacket.c
index 0baacebc..072a40e5 100644
--- a/gst/asfdemux/asfpacket.c
+++ b/gst/asfdemux/asfpacket.c
@@ -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);
diff --git a/gst/asfdemux/asfpacket.h b/gst/asfdemux/asfpacket.h
index cc1622de..dd8bd86f 100644
--- a/gst/asfdemux/asfpacket.h
+++ b/gst/asfdemux/asfpacket.h
@@ -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) */