Commit 852d47d8 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
(cherry picked from commit 9285476128051fd0b5ae2983d619289d110b12eb)
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent b49dc66d
......@@ -369,6 +369,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