Mercurial > hg > dmlib
changeset 1219:62a76a3d9bc2
Merged.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Fri, 06 Mar 2015 09:45:55 +0200 |
parents | 30c2dbf05841 (diff) 96ad216e9b59 (current diff) |
children | fc2ab4dcd046 |
files | minijss/jloadjss.c |
diffstat | 1 files changed, 12 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/minijss/jloadjss.c Thu Mar 05 23:28:58 2015 +0200 +++ b/minijss/jloadjss.c Fri Mar 06 09:45:55 2015 +0200 @@ -327,6 +327,18 @@ if (probe) return DMERR_OK; + // Check some of the things for sanity + if (jssH.nchannels > jsetMaxChannels || + jssH.nchannels == 0 || + jssH.norders > jsetMaxOrders || + jssH.npatterns > jsetMaxPatterns || + jssH.nextInstruments > jsetMaxInstruments || + jssH.ninstruments > jsetMaxInstruments) + { + JSSERROR(DMERR_INVALID_DATA, DMERR_INVALID_DATA, + "Invalid values in JSSMOD header.\n"); + } + // Allocate the module module = jssAllocateModule(); if (module == NULL)