Commit 560017ec authored by alex's avatar alex

check for channels<=0 and print a reasonable error message

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@8857 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent dc39d0e1
...@@ -70,8 +70,10 @@ static int MPA_encode_init(AVCodecContext *avctx) ...@@ -70,8 +70,10 @@ static int MPA_encode_init(AVCodecContext *avctx)
int i, v, table; int i, v, table;
float a; float a;
if (channels > 2) if (channels <= 0 || channels > 2){
av_log(avctx, AV_LOG_ERROR, "encoding %d channel(s) is not allowed in mp2\n", channels);
return -1; return -1;
}
bitrate = bitrate / 1000; bitrate = bitrate / 1000;
s->nb_channels = channels; s->nb_channels = channels;
s->freq = freq; s->freq = freq;
......
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