Bug 863929: Fix codec list loop exit calculation r=ehugg
authorRandell Jesup <rjesup@jesup.org>
Mon, 22 Apr 2013 14:49:42 -0400
changeset 140460 4d94e34d8eb46863fc8ee614550f6eaa8205ef52
parent 140459 c9135550a85f6871a87c9eabed3d09bd0ebd34b1
child 140461 b4b8b381307e47718c4b77c1176499170184ddda
push id2579
push userakeybl@mozilla.com
push dateMon, 24 Jun 2013 18:52:47 +0000
treeherdermozilla-beta@b69b7de8a05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehugg
bugs863929
milestone23.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 863929: Fix codec list loop exit calculation r=ehugg
media/webrtc/signaling/src/sipcc/core/gsm/gsm_sdp.c
--- a/media/webrtc/signaling/src/sipcc/core/gsm/gsm_sdp.c
+++ b/media/webrtc/signaling/src/sipcc/core/gsm/gsm_sdp.c
@@ -3242,25 +3242,25 @@ gsmsdp_negotiate_codec (fsmdef_dcb_t *dc
                 } /* end video */
 
                 GSM_DEBUG(DEB_L_C_F_PREFIX"codec= %d\n",
                       DEB_L_C_F_PREFIX_ARGS(GSM, dcb_p->line,
                                             dcb_p->call_id, fname), codec);
 
 
                 found_codec = TRUE;
-                if(media->num_payloads >= payload_types_count) {
-                    /* We maxed our allocated memory -- processing is done. */
-                    return codec;
-                }
 
                 /* Incrementing this number serves as a "commit" for the
                    payload_info. If we bail out of the loop before this
                    happens, then the collected information is abandoned. */
                 media->num_payloads++;
+                if(media->num_payloads >= payload_types_count) {
+                    /* We maxed our allocated memory -- processing is done. */
+                    return codec;
+                }
 
                 if(offer) {
                     /* If we are creating an answer, return after the first match.
                        TODO -- Eventually, we'll (probably) want to answer with
                        all the codecs we can receive. See bug 814227. */
                     return codec;
                 }
             }