GNOME Bugzilla – Bug 785991
rtpstats: fix unsigned integer comparisons.
Last modified: 2017-08-17 10:42:30 UTC
Callers of the API (rtpsource, rtpjitterbuffer) pass clock_rate as a signed integer, and the comparison "<= 0" is used against it, leading me to think the intention was to have the field be typed as gint32, not guint32. This led to situations where we could call scale_int with a MAX_UINT32 (-1) guint32 as the denom, thus raising an assertion.
Created attachment 357184 [details] [review] rtpstats: fix unsigned integer comparisons.
Created attachment 357185 [details] [review] rtpstats: fix unsigned integer comparisons. Callers of the API (rtpsource, rtpjitterbuffer) pass clock_rate as a signed integer, and the comparison "<= 0" is used against it, leading me to think the intention was to have the field be typed as gint32, not guint32. This led to situations where we could call scale_int with a MAX_UINT32 (-1) guint32 as the denom, thus raising an assertion.
Attachment 357185 [details] pushed as 5e48e85 - rtpstats: fix unsigned integer comparisons.
Also for 1.12?
Well a commit was actually backported there that prevents the problem from happening (c9465db1b73432a92f49f59911219aed60a11407), once the conflict was resolved what this commit did was simply making things a bit more consistent, so I don't think backporting this is needed