comparison mpegaudiodec.c @ 2477:7b65742a88ac libavcodec

10l (missing overflow check)
author michael
date Mon, 31 Jan 2005 03:14:22 +0000
parents 73afecc117a3
children 6744ea5ff950
comparison
equal deleted inserted replaced
2476:38dbec9a148d 2477:7b65742a88ac
229 e += (exponent >> 2); 229 e += (exponent >> 2);
230 e = FRAC_BITS - e; 230 e = FRAC_BITS - e;
231 #if FRAC_BITS <= 15 231 #if FRAC_BITS <= 15
232 if (e > 31) 232 if (e > 31)
233 e = 31; 233 e = 31;
234 #else
235 if (e > 63)
236 e = 63;
234 #endif 237 #endif
235 m = table_4_3_value[value]; 238 m = table_4_3_value[value];
236 #if FRAC_BITS <= 15 239 #if FRAC_BITS <= 15
237 m = (m * scale_factor_mult3[exponent & 3]); 240 m = (m * scale_factor_mult3[exponent & 3]);
238 m = (m + (1 << (e-1))) >> e; 241 m = (m + (1 << (e-1))) >> e;
2135 files[fnum] = f; 2138 files[fnum] = f;
2136 } 2139 }
2137 2140
2138 if (fnum == 0) { 2141 if (fnum == 0) {
2139 static int pos = 0; 2142 static int pos = 0;
2140 printf("pos=%d\n", pos); 2143 av_log(NULL, AV_LOG_DEBUG, "pos=%d\n", pos);
2141 for(i=0;i<n;i++) { 2144 for(i=0;i<n;i++) {
2142 printf(" %0.4f", (double)tab[i] / FRAC_ONE); 2145 av_log(NULL, AV_LOG_DEBUG, " %0.4f", (double)tab[i] / FRAC_ONE);
2143 if ((i % 18) == 17) 2146 if ((i % 18) == 17)
2144 printf("\n"); 2147 av_log(NULL, AV_LOG_DEBUG, "\n");
2145 } 2148 }
2146 pos += n; 2149 pos += n;
2147 } 2150 }
2148 for(i=0;i<n;i++) { 2151 for(i=0;i<n;i++) {
2149 /* normalize to 23 frac bits */ 2152 /* normalize to 23 frac bits */