From 6e361a52fb0baac63bad56d71ffa90b1d26fb729 Mon Sep 17 00:00:00 2001 From: irungentoo Date: Tue, 25 Nov 2014 17:22:44 -0500 Subject: [PATCH] Fixed integer rollover bug in toxav. --- toxav/toxav.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/toxav/toxav.c b/toxav/toxav.c index f4eafaf8..d7de0326 100644 --- a/toxav/toxav.c +++ b/toxav/toxav.c @@ -151,7 +151,11 @@ uint32_t toxav_do_interval(ToxAv *av) rc = MIN(av->calls[i].cs->audio_decoder_frame_duration, rc); } - return rc - av->avgdectms; + if (rc < av->avgdectms) { + return 0; + } else { + return rc - av->avgdectms; + } } void toxav_do(ToxAv *av)