Commit 32b4d549 authored by Philipp Schafft's avatar Philipp Schafft 🦁

Fix: Do not segfaul on bad Opus streams

parent a0ab967f
......@@ -72,7 +72,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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment