mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-23 07:38:16 +00:00
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.
This commit is contained in:
parent
56688ce078
commit
44b18ea2b6
1 changed files with 6 additions and 4 deletions
|
@ -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,
|
||||
&chunk_count))
|
||||
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,
|
||||
&end_seq))
|
||||
g_return_val_if_reached (FALSE);
|
||||
|
||||
if (seq >= end_seq || seq < begin_seq)
|
||||
return FALSE;
|
||||
|
|
Loading…
Reference in a new issue