diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2011-06-04 00:16:12 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-06-04 00:16:12 +0200 |
commit | 33af5335fd8e1b411bb1bdfad93b675033866c2c (patch) | |
tree | 02537773dbb71cd98bfb0fe9e4d08fa3919dac59 | |
parent | 49125aeddcfe1990ab4159d1b144b9387182452b (diff) | |
download | ffmpeg-33af5335fd8e1b411bb1bdfad93b675033866c2c.tar.gz |
ffplay: error out with invalid sample rate or channels.
Fixes Ticket119
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | ffplay.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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; |