ref: 9cbf6341a0773f856eb669cb9daa441d20aea366
parent: a6e2476e4d56cde5249ad0525afdda85f38f27da
author: knik <knik>
date: Sat Jul 1 04:58:58 EDT 2017
one more wave format check
--- a/frontend/input.c
+++ b/frontend/input.c
@@ -16,7 +16,7 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id: input.c,v 1.17 2010/09/07 15:14:02 knik Exp $
+ * $Id: input.c,v 1.18 2017/07/01 08:58:58 knik Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -182,6 +182,10 @@
memset(&wave, 0, sizeof(wave));
fmtsize = (riffsub.len < sizeof(wave)) ? riffsub.len : sizeof(wave);
+ // check if format is at least WAVEFORMATEX long
+ if (fmtsize < sizeof(struct WAVEFORMATEX))
+ return NULL;
+
if (fread(&wave, 1, fmtsize, wave_f) != fmtsize)
return NULL;