Commit 92854761 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Smem: don't divide by 0

Fix #4479
See https://bugs.kde.org/show_bug.cgi?id=279973
parent ab9b56ca
......@@ -392,6 +392,13 @@ static int SendAudio( sout_stream_t *p_stream, sout_stream_id_t *id,
int i_samples = 0;
i_size = p_buffer->i_buffer;
if (id->format->audio.i_channels <= 0)
{
msg_Warn( p_stream, "No buffer given!" );
block_ChainRelease( p_buffer );
return VLC_EGENERIC;
}
i_samples = i_size / ( ( id->format->audio.i_bitspersample / 8 ) * id->format->audio.i_channels );
/* Calling the prerender callback to get user buffer */
p_sys->pf_audio_prerender_callback( id->p_data, &p_pcm_buffer, i_size );
......
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