summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThiago Santos <thiagoss@osg.samsung.com>2015-02-04 02:25:44 -0300
committerThiago Santos <thiagoss@osg.samsung.com>2015-02-04 21:37:50 -0300
commita6d73797d091a0e4ac33eaf516056103f7ffb1e8 (patch)
treef8930405fd6f39faaeb8f0eb0908a74baf16e1dc
parenta3059bec1f4d32c42d3aae27834fd520c8bbb65d (diff)
rtph264depay: prevent trying to get 0 bytes from adapter
This causes an assertion and would lead to getting a NULL instead of a buffer. Without proper checking this would easily lead to a segfault https://bugzilla.gnome.org/show_bug.cgi?id=737199
-rw-r--r--gst/rtp/gstrtph264depay.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/gst/rtp/gstrtph264depay.c b/gst/rtp/gstrtph264depay.c
index 586cf7342..756730cb8 100644
--- a/gst/rtp/gstrtph264depay.c
+++ b/gst/rtp/gstrtph264depay.c
@@ -955,10 +955,12 @@ gst_rtp_h264_depay_process (GstRTPBaseDepayload * depayload, GstBuffer * buf)
}
outsize = gst_adapter_available (rtph264depay->adapter);
- outbuf = gst_adapter_take_buffer (rtph264depay->adapter, outsize);
-
- outbuf = gst_rtp_h264_depay_handle_nal (rtph264depay, outbuf, timestamp,
- marker);
+ if (outsize > 0) {
+ outbuf = gst_adapter_take_buffer (rtph264depay->adapter, outsize);
+ outbuf =
+ gst_rtp_h264_depay_handle_nal (rtph264depay, outbuf, timestamp,
+ marker);
+ }
break;
}
case 26: