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:
5318a03
)
bufferlist: Add check for overflow
author
Edward Hervey
<edward@centricular.com>
Wed, 18 Mar 2020 10:10:13 +0000
(11:10 +0100)
committer
Edward Hervey
<bilboed@bilboed.com>
Wed, 18 Mar 2020 10:10:13 +0000
(11:10 +0100)
gst/gstbufferlist.c
patch
|
blob
|
history
diff --git
a/gst/gstbufferlist.c
b/gst/gstbufferlist.c
index 2c1359769e2ee5e529a6bb5e13ca8ea16c524c4e..59fbcafc5f9ab649ebbd99fef365bd2a2eb068c4 100644
(file)
--- a/
gst/gstbufferlist.c
+++ b/
gst/gstbufferlist.c
@@
-436,6
+436,9
@@
gst_buffer_list_insert (GstBufferList * list, gint idx, GstBuffer * buffer)
want_alloc = list->n_buffers + 1;
if (want_alloc > list->n_allocated) {
+ if (G_UNLIKELY (list->n_allocated > (G_MAXUINT / 2)))
+ g_error ("Growing GstBufferList would result in overflow");
+
want_alloc = MAX (GST_ROUND_UP_16 (want_alloc), list->n_allocated * 2);
if (GST_BUFFER_LIST_IS_USING_DYNAMIC_ARRAY (list)) {