1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

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

Originally committed as revision 8857 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Alex Beregszaszi 2007-04-29 13:25:32 +00:00
parent b46d68c634
commit 07d84a4e9f

View File

@ -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;