diff options
author | Luis de Bethencourt <luis@debethencourt.com> | 2015-08-12 14:59:53 +0100 |
---|---|---|
committer | Luis de Bethencourt <luis@debethencourt.com> | 2015-08-12 15:05:02 +0100 |
commit | 9379933607248b1ad3b1fd715405b64f5fa2b421 (patch) | |
tree | 77aa41ef57d8789bce8dd0d2c1ff83c0bc461d1c /gst | |
parent | 8a6cc4ed27dfc596c75b43ffe6eda36fcbd03781 (diff) | |
download | gstreamer-plugins-bad-9379933607248b1ad3b1fd715405b64f5fa2b421.tar.gz |
rtph265depay: 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.
Related to rpth264depay: https://bugzilla.gnome.org/show_bug.cgi?id=737199
Diffstat (limited to 'gst')
-rw-r--r-- | gst/rtp/gstrtph265depay.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/gst/rtp/gstrtph265depay.c b/gst/rtp/gstrtph265depay.c index 941a5dbf8..15599ccd8 100644 --- a/gst/rtp/gstrtph265depay.c +++ b/gst/rtp/gstrtph265depay.c @@ -1167,10 +1167,12 @@ gst_rtp_h265_depay_process (GstRTPBaseDepayload * depayload, GstBuffer * buf) } outsize = gst_adapter_available (rtph265depay->adapter); - outbuf = gst_adapter_take_buffer (rtph265depay->adapter, outsize); - - outbuf = gst_rtp_h265_depay_handle_nal (rtph265depay, outbuf, timestamp, - marker); + if (outsize > 0) { + outbuf = gst_adapter_take_buffer (rtph265depay->adapter, outsize); + outbuf = + gst_rtp_h265_depay_handle_nal (rtph265depay, outbuf, timestamp, + marker); + } break; } case 49: |