gst/: Handle negative offsets better. Fixes decodebin.

Original commit message from CVS:
* gst/base/gsttypefindhelper.c: (helper_find_peek):
* gst/elements/gsttypefindelement.c: (find_peek):
Handle negative offsets better. Fixes decodebin.
This commit is contained in:
Ronald S. Bultje 2005-05-09 15:54:26 +00:00
parent e70ec7b807
commit 5b9c84091d
5 changed files with 10 additions and 4 deletions

View file

@ -1,3 +1,9 @@
2005-05-09 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
* gst/base/gsttypefindhelper.c: (helper_find_peek):
* gst/elements/gsttypefindelement.c: (find_peek):
Handle negative offsets better. Fixes decodebin.
2005-05-09 Wim Taymans <wim@fluendo.com>
* gst/base/gstbasetransform.c: (gst_base_transform_proxy_getcaps),

View file

@ -57,7 +57,7 @@ helper_find_peek (gpointer data, gint64 offset, guint size)
src = find->src;
if (offset < 0) {
if (find->size == -1)
if (find->size == -1 || find->size < -offset)
return NULL;
offset += find->size;

View file

@ -572,7 +572,7 @@ find_peek (gpointer data, gint64 offset, guint size)
/* FIXME: can we do this easily without querying length? */
guint64 length = find_element_get_length (data);
if (length == 0) {
if (length < -offset) {
buf = NULL;
} else {
buf =

View file

@ -57,7 +57,7 @@ helper_find_peek (gpointer data, gint64 offset, guint size)
src = find->src;
if (offset < 0) {
if (find->size == -1)
if (find->size == -1 || find->size < -offset)
return NULL;
offset += find->size;

View file

@ -572,7 +572,7 @@ find_peek (gpointer data, gint64 offset, guint size)
/* FIXME: can we do this easily without querying length? */
guint64 length = find_element_get_length (data);
if (length == 0) {
if (length < -offset) {
buf = NULL;
} else {
buf =