mirror of
https://github.com/moonlight-stream/moonlight-common-c.git
synced 2025-08-18 09:25:49 +00:00
Fix memory leak in audio stream code
This commit is contained in:
parent
e27218f56e
commit
0f586ce05f
@ -112,12 +112,12 @@ static void DecoderThreadProc(void* context) {
|
|||||||
|
|
||||||
if (length < sizeof(RTP_PACKET)) {
|
if (length < sizeof(RTP_PACKET)) {
|
||||||
Limelog("Runt packet\n");
|
Limelog("Runt packet\n");
|
||||||
continue;
|
goto freeandcontinue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rtp->packetType != 97) {
|
if (rtp->packetType != 97) {
|
||||||
// Not audio
|
// Not audio
|
||||||
continue;
|
goto freeandcontinue;
|
||||||
}
|
}
|
||||||
|
|
||||||
rtp->sequenceNumber = htons(rtp->sequenceNumber);
|
rtp->sequenceNumber = htons(rtp->sequenceNumber);
|
||||||
@ -131,6 +131,9 @@ static void DecoderThreadProc(void* context) {
|
|||||||
lastSeq = rtp->sequenceNumber;
|
lastSeq = rtp->sequenceNumber;
|
||||||
|
|
||||||
callbacks.decodeAndPlaySample((char *) (rtp + 1), length - sizeof(*rtp));
|
callbacks.decodeAndPlaySample((char *) (rtp + 1), length - sizeof(*rtp));
|
||||||
|
|
||||||
|
freeandcontinue:
|
||||||
|
free(data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user