projects
/
platform
/
upstream
/
gstreamer.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
75e0a3c
)
queuearray: fix expanding size of queue from 1
author
Evan Nemerson
<evan@nemerson.com>
Fri, 6 Jun 2014 23:36:00 +0000
(16:36 -0700)
committer
Tim-Philipp Müller
<tim@centricular.com>
Sat, 7 Jun 2014 08:45:39 +0000
(09:45 +0100)
Without we would not actually expand and access
memory beyond the allocated region for the array.
https://bugzilla.gnome.org/show_bug.cgi?id=731349
libs/gst/base/gstqueuearray.c
patch
|
blob
|
history
diff --git
a/libs/gst/base/gstqueuearray.c
b/libs/gst/base/gstqueuearray.c
index
8061ff1
..
d37535d
100644
(file)
--- a/
libs/gst/base/gstqueuearray.c
+++ b/
libs/gst/base/gstqueuearray.c
@@
-145,7
+145,7
@@
gst_queue_array_push_tail (GstQueueArray * array, gpointer data)
/* Check if we need to make room */
if (G_UNLIKELY (array->length == array->size)) {
/* newsize is 50% bigger */
- guint newsize =
(3 * array->size) / 2
;
+ guint newsize =
MAX ((3 * array->size) / 2, array->size + 1)
;
/* copy over data */
if (array->tail != 0) {