Commit 33af5335 authored by Michael Niedermayer's avatar Michael Niedermayer

ffplay: error out with invalid sample rate or channels.

Fixes Ticket119
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 49125aed
......@@ -2158,6 +2158,10 @@ static int stream_component_open(VideoState *is, int stream_index)
/* prepare audio output */
if (avctx->codec_type == AVMEDIA_TYPE_AUDIO) {
if(avctx->sample_rate <= 0 || avctx->channels <= 0){
fprintf(stderr, "Invalid sample rate or channel count\n");
return -1;
}
wanted_spec.freq = avctx->sample_rate;
wanted_spec.format = AUDIO_S16SYS;
wanted_spec.channels = avctx->channels;
......
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