Fix strict aliasing violation

This commit is contained in:
Cameron Gutman 2018-07-21 19:16:08 -07:00
parent 27239ff320
commit dc723a8da1

View file

@ -123,6 +123,11 @@ NvHTTP::launchApp(int appId,
bool localAudio, bool localAudio,
int gamepadMask) int gamepadMask)
{ {
int riKeyId;
memcpy(&riKeyId, streamConfig->remoteInputAesIv, sizeof(riKeyId));
riKeyId = qFromBigEndian(riKeyId);
QString response = QString response =
openConnectionToString(m_BaseUrlHttps, openConnectionToString(m_BaseUrlHttps,
"launch", "launch",
@ -132,7 +137,7 @@ NvHTTP::launchApp(int appId,
QString::number(streamConfig->fps)+ QString::number(streamConfig->fps)+
"&additionalStates=1&sops="+QString::number(sops ? 1 : 0)+ "&additionalStates=1&sops="+QString::number(sops ? 1 : 0)+
"&rikey="+QByteArray(streamConfig->remoteInputAesKey, sizeof(streamConfig->remoteInputAesKey)).toHex()+ "&rikey="+QByteArray(streamConfig->remoteInputAesKey, sizeof(streamConfig->remoteInputAesKey)).toHex()+
"&rikeyid="+QString::number(qFromBigEndian(*(int*)streamConfig->remoteInputAesIv))+ "&rikeyid="+QString::number(riKeyId)+
(streamConfig->enableHdr ? (streamConfig->enableHdr ?
"&hdrMode=1&clientHdrCapVersion=0&clientHdrCapSupportedFlagsInUint32=0&clientHdrCapMetaDataId=NV_STATIC_METADATA_TYPE_1&clientHdrCapDisplayData=0x0x0x0x0x0x0x0x0x0x0" : "&hdrMode=1&clientHdrCapVersion=0&clientHdrCapSupportedFlagsInUint32=0&clientHdrCapMetaDataId=NV_STATIC_METADATA_TYPE_1&clientHdrCapDisplayData=0x0x0x0x0x0x0x0x0x0x0" :
"")+ "")+
@ -149,11 +154,16 @@ NvHTTP::launchApp(int appId,
void void
NvHTTP::resumeApp(PSTREAM_CONFIGURATION streamConfig) NvHTTP::resumeApp(PSTREAM_CONFIGURATION streamConfig)
{ {
int riKeyId;
memcpy(&riKeyId, streamConfig->remoteInputAesIv, sizeof(riKeyId));
riKeyId = qFromBigEndian(riKeyId);
QString response = QString response =
openConnectionToString(m_BaseUrlHttps, openConnectionToString(m_BaseUrlHttps,
"resume", "resume",
"rikey="+QString(QByteArray(streamConfig->remoteInputAesKey, sizeof(streamConfig->remoteInputAesKey)).toHex())+ "rikey="+QString(QByteArray(streamConfig->remoteInputAesKey, sizeof(streamConfig->remoteInputAesKey)).toHex())+
"&rikeyid="+QString::number(qFromBigEndian(*(int*)streamConfig->remoteInputAesIv))+ "&rikeyid="+QString::number(riKeyId)+
"&surroundAudioInfo="+getSurroundAudioInfoString(streamConfig->audioConfiguration), "&surroundAudioInfo="+getSurroundAudioInfoString(streamConfig->audioConfiguration),
false); false);