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:
61f04f1
)
rtpbuffer: protect against empty buffers
author
Wim Taymans
<wim.taymans@collabora.co.uk>
Mon, 12 Nov 2012 10:17:56 +0000
(11:17 +0100)
committer
Wim Taymans
<wim.taymans@collabora.co.uk>
Mon, 12 Nov 2012 10:18:16 +0000
(11:18 +0100)
gst-libs/gst/rtp/gstrtpbuffer.c
patch
|
blob
|
history
diff --git
a/gst-libs/gst/rtp/gstrtpbuffer.c
b/gst-libs/gst/rtp/gstrtpbuffer.c
index
b9d5675
..
800752e
100644
(file)
--- a/
gst-libs/gst/rtp/gstrtpbuffer.c
+++ b/
gst-libs/gst/rtp/gstrtpbuffer.c
@@
-327,6
+327,9
@@
gst_rtp_buffer_map (GstBuffer * buffer, GstMapFlags flags, GstRTPBuffer * rtp)
g_return_val_if_fail (rtp != NULL, FALSE);
g_return_val_if_fail (rtp->buffer == NULL, FALSE);
+ if (gst_buffer_n_memory (buffer) < 1)
+ goto no_memory;
+
/* map first memory, this should be the header */
if (!gst_buffer_map_range (buffer, 0, 1, &rtp->map[0], flags))
goto map_failed;
@@
-420,6
+423,11
@@
gst_rtp_buffer_map (GstBuffer * buffer, GstMapFlags flags, GstRTPBuffer * rtp)
return TRUE;
/* ERRORS */
+no_memory:
+ {
+ GST_ERROR ("buffer without memory");
+ return FALSE;
+ }
map_failed:
{
GST_ERROR ("failed to map memory");