comparison ac3dec.c @ 8275:e2ef97f0ab4b libavcodec

ac3dec: simplify exponent bounds checking
author jbr
date Sat, 06 Dec 2008 16:33:16 +0000
parents 52af55b08c1d
children 6c2dcc1410bb
comparison
equal deleted inserted replaced
8274:82dbfe8d2e0b 8275:e2ef97f0ab4b
390 390
391 /* convert to absolute exps and expand groups */ 391 /* convert to absolute exps and expand groups */
392 prevexp = absexp; 392 prevexp = absexp;
393 for(i=0,j=0; i<ngrps*3; i++) { 393 for(i=0,j=0; i<ngrps*3; i++) {
394 prevexp += dexp[i] - 2; 394 prevexp += dexp[i] - 2;
395 if (prevexp < 0 || prevexp > 24) 395 if (prevexp > 24U)
396 return -1; 396 return -1;
397 switch (group_size) { 397 switch (group_size) {
398 case 4: dexps[j++] = prevexp; 398 case 4: dexps[j++] = prevexp;
399 dexps[j++] = prevexp; 399 dexps[j++] = prevexp;
400 case 2: dexps[j++] = prevexp; 400 case 2: dexps[j++] = prevexp;