MT#57445 '.SdpPayload::type' may be used uninitialized in this function

We have to explicitly set the `SdpPayload.type`,
when calling the constructor of it, which only initializes the `SdpPayload.payload_type`.
Just simply set the `SdpPayload.type` to -1.

This fixes the following:

     In file included from ../../core/AmRtpStream.h:32,
                      from ../../core/AmSession.h:31,
                      from ../../core/AmB2BSession.h:31,
                      from CallLeg.h:29,
                      from CallLeg.cpp:27:
     ../../core/AmSdp.h: In member function 'void CallLeg::acceptPendingInvite(AmSipRequest*)':
     ../../core/AmSdp.h:130:18: warning: '<anonymous>.SdpPayload::type' may be used uninitialized in this function [-Wmaybe-uninitialized]
       130 |     : type(other.type), payload_type(other.payload_type),
           |            ~~~~~~^~~~

Change-Id: I08a9e75396f043dc88d411b9c84296a704d67057
mr11.4.1
Donat Zenichev 3 years ago
parent c37a8cc1e0
commit 4bec183a9a

@ -116,7 +116,8 @@ struct SdpPayload
{}
SdpPayload(int pt)
: payload_type(pt),
: type(-1),
payload_type(pt),
clock_rate(-1),
encoding_param(-1)
{}

Loading…
Cancel
Save