summaryrefslogtreecommitdiffstats
path: root/gst-libs/gst/riff
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@gmail.com>2004-07-16 10:50:49 +0000
committerWim Taymans <wim.taymans@gmail.com>2004-07-16 10:50:49 +0000
commit736e529e7c5bcdc4e69868ccf33e7ff32926dfbf (patch)
treef58ac668ff779c5d78e9958e533ec92ca135a34b /gst-libs/gst/riff
parentd5c4a86bae7272550f25a88b0d271c6a1f8c035e (diff)
downloadgst-plugins-bad-736e529e7c5bcdc4e69868ccf33e7ff32926dfbf.tar.gz
gst-plugins-bad-736e529e7c5bcdc4e69868ccf33e7ff32926dfbf.tar.bz2
gst-plugins-bad-736e529e7c5bcdc4e69868ccf33e7ff32926dfbf.zip
gst/: Make sure we don't create 0 sized subbufers in riff-read.
Original commit message from CVS: * gst-libs/gst/riff/riff-read.c: (gst_riff_read_strf_vids_with_data), (gst_riff_read_strf_auds_with_data): * gst/avi/gstavidemux.c: (gst_avi_demux_handle_src_query), (gst_avi_demux_add_stream), (gst_avi_demux_stream_header): Make sure we don't create 0 sized subbufers in riff-read. Signal the no more pads signal after reading the avi header.
Diffstat (limited to 'gst-libs/gst/riff')
-rw-r--r--gst-libs/gst/riff/riff-read.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/gst-libs/gst/riff/riff-read.c b/gst-libs/gst/riff/riff-read.c
index 405324ab..11740f2a 100644
--- a/gst-libs/gst/riff/riff-read.c
+++ b/gst-libs/gst/riff/riff-read.c
@@ -551,8 +551,12 @@ gst_riff_read_strf_vids_with_data (GstRiffRead * riff,
strf->size, GST_BUFFER_SIZE (buf));
strf->size = GST_BUFFER_SIZE (buf);
} else if (strf->size < GST_BUFFER_SIZE (buf)) {
- *extradata = gst_buffer_create_sub (buf, strf->size + 2,
- GST_BUFFER_SIZE (buf) - strf->size - 2);
+ gint len;
+
+ len = GST_BUFFER_SIZE (buf) - strf->size - 2;
+ if (len > 0) {
+ *extradata = gst_buffer_create_sub (buf, strf->size + 2, len);
+ }
}
/* debug */
@@ -636,8 +640,12 @@ gst_riff_read_strf_auds_with_data (GstRiffRead * riff,
strf->size, GST_BUFFER_SIZE (buf));
strf->size = GST_BUFFER_SIZE (buf);
} else if (strf->size < GST_BUFFER_SIZE (buf)) {
- *extradata = gst_buffer_create_sub (buf, strf->size + 2,
- GST_BUFFER_SIZE (buf) - strf->size - 2);
+ gint len;
+
+ len = GST_BUFFER_SIZE (buf) - strf->size - 2;
+ if (len > 0) {
+ *extradata = gst_buffer_create_sub (buf, strf->size + 2, len);
+ }
}
/* debug */