memory: add check for writablity in resize

Add guard to gst_memory_resize() to make sure the
memory to be resized is actually writable.

https://bugzilla.gnome.org/show_bug.cgi?id=747392
This commit is contained in:
Prashant Gotarne 2015-04-06 10:18:15 +05:30 committed by Tim-Philipp Müller
parent fd67f40e4d
commit 6a8f65936b

View file

@ -197,6 +197,7 @@ void
gst_memory_resize (GstMemory * mem, gssize offset, gsize size)
{
g_return_if_fail (mem != NULL);
g_return_if_fail (gst_memory_is_writable (mem));
g_return_if_fail (offset >= 0 || mem->offset >= -offset);
g_return_if_fail (size + mem->offset + offset <= mem->maxsize);