Commit 9d3bed1a authored by Clément Bœsch's avatar Clément Bœsch Committed by Philipp Schafft

Fix: check ogg_sync_buffer() pointer before writing to it

ogg_sync_buffer() can return NULL on several scenarios, the first one
being if ogg_sync_check() fails, but it can also happen in case of an
allocation failure, or internal bug.
parent 6598fd21
...@@ -92,6 +92,8 @@ static int send_ogg(shout_t *self, const unsigned char *data, size_t len) ...@@ -92,6 +92,8 @@ static int send_ogg(shout_t *self, const unsigned char *data, size_t len)
ogg_page page; ogg_page page;
buffer = ogg_sync_buffer(&ogg_data->oy, len); buffer = ogg_sync_buffer(&ogg_data->oy, len);
if (!buffer)
return self->error = SHOUTERR_INSANE;
memcpy(buffer, data, len); memcpy(buffer, data, len);
ogg_sync_wrote(&ogg_data->oy, len); ogg_sync_wrote(&ogg_data->oy, len);
......
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