rtph265pay: fix buffer leak when using SPS/PPS
authorLuis de Bethencourt <luis@debethencourt.com>
Fri, 14 Aug 2015 14:08:08 +0000 (15:08 +0100)
committerLuis de Bethencourt <luis@debethencourt.com>
Fri, 14 Aug 2015 14:08:10 +0000 (15:08 +0100)
Fixes a buffer leak that would occur if the pipeline was shutdown while a
SPS/PPS header was being created.

https://bugzilla.gnome.org/show_bug.cgi?id=741271

gst/rtp/gstrtph265pay.c

index 0cd8b87..0a5bac6 100644 (file)
@@ -995,8 +995,10 @@ gst_rtp_h265_pay_payload_nal (GstRTPBasePayload * basepayload,
      * checking when we need to send SPS/PPS but convert to running_time first. */
     rtph265pay->send_vps_sps_pps = FALSE;
     ret = gst_rtp_h265_pay_send_vps_sps_pps (basepayload, rtph265pay, dts, pts);
-    if (ret != GST_FLOW_OK)
+    if (ret != GST_FLOW_OK) {
+      gst_buffer_unref (paybuf);
       return ret;
+    }
   }
 
   packet_len = gst_rtp_buffer_calc_packet_len (size, 0, 0);