Commit 44b18ea2 authored by Tim-Philipp Müller's avatar Tim-Philipp Müller 🐠

rtcpbuffer: fix function guards with side effects

Code in g_return_*() must not have side effects, as it
might be compiled out if -DG_DISABLE_CHECKS is used, in
which case we would read garbage off the stack.
parent 56688ce0
......@@ -2822,8 +2822,9 @@ gst_rtcp_packet_xr_get_rle_nth_chunk (GstRTCPPacket * packet,
guint32 chunk_count;
guint8 *data;
g_return_val_if_fail (gst_rtcp_packet_xr_get_rle_info (packet, NULL, NULL,
NULL, NULL, &chunk_count), FALSE);
if (!gst_rtcp_packet_xr_get_rle_info (packet, NULL, NULL, NULL, NULL,
g_return_val_if_reached (FALSE);
if (nth >= chunk_count)
return FALSE;
......@@ -2917,8 +2918,9 @@ gst_rtcp_packet_xr_get_prt_by_seq (GstRTCPPacket * packet,
guint16 begin_seq, end_seq;
guint8 *data;
g_return_val_if_fail (gst_rtcp_packet_xr_get_prt_info (packet, NULL, NULL,
&begin_seq, &end_seq), FALSE);
if (!gst_rtcp_packet_xr_get_prt_info (packet, NULL, NULL, &begin_seq,
g_return_val_if_reached (FALSE);
if (seq >= end_seq || seq < begin_seq)
return FALSE;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment