Sanity check number of channels in setup.
authorThomas Daede <daede003@umn.edu>
Thu, 17 May 2018 23:19:19 +0000 (16:19 -0700)
committerThomas Daede <daede003@umn.edu>
Thu, 17 May 2018 23:23:55 +0000 (16:23 -0700)
Fixes #2335.

lib/vorbisenc.c

index 4fc7b62..64a51b5 100644 (file)
@@ -684,6 +684,7 @@ int vorbis_encode_setup_init(vorbis_info *vi){
   highlevel_encode_setup *hi=&ci->hi;
 
   if(ci==NULL)return(OV_EINVAL);
+  if(vi->channels<1||vi->channels>255)return(OV_EINVAL);
   if(!hi->impulse_block_p)i0=1;
 
   /* too low/high an ATH floater is nonsensical, but doesn't break anything */