Add some safeguards here

This commit is contained in:
twinaphex 2018-01-22 21:48:28 +01:00
parent 6208981ad3
commit a80fb7c969
2 changed files with 3 additions and 2 deletions

View File

@ -1160,7 +1160,7 @@ void rpng_free(rpng_t *rpng)
free(rpng->process->inflate_buf);
if (rpng->process->stream)
{
if (rpng->process->stream_backend)
if (rpng->process->stream_backend && rpng->process->stream_backend->stream_free)
rpng->process->stream_backend->stream_free(rpng->process->stream);
else
free(rpng->process->stream);

View File

@ -285,7 +285,8 @@ bool netplay_lan_ad_server(netplay_t *netplay)
continue;
}
strlcpy(reply_addr, ad_packet_buffer.address, NETPLAY_HOST_STR_LEN);
if (!string_is_empty(ad_packet_buffer.address))
strlcpy(reply_addr, ad_packet_buffer.address, NETPLAY_HOST_STR_LEN);
for (k = 0; k < interfaces.size; k++)
{