1
0
mirror of https://gitlab.xiph.org/xiph/icecast-server.git synced 2024-06-23 06:25:24 +00:00

Fix: Do not segfaul on bad Opus streams

This commit is contained in:
Philipp Schafft 2016-09-04 14:03:17 +00:00
parent 5b512da304
commit 89804764b0

View File

@ -218,7 +218,7 @@ ogg_codec_t *initial_opus_page (format_plugin_t *plugin, ogg_page *page)
ogg_stream_packetout (&codec->os, &packet);
ICECAST_LOG_DEBUG("checking for opus codec");
if (strncmp((char *)packet.packet, "OpusHead", 8) != 0)
if (packet.bytes < 8 || strncmp((char *)packet.packet, "OpusHead", 8) != 0)
{
ogg_stream_clear (&codec->os);
free (codec);