Changeset 487 for libmpc/trunk/mpcgain
- Timestamp:
- 01/10/16 22:36:06 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libmpc/trunk/mpcgain/mpcgain.c
r477 r487 116 116 while (1) { 117 117 fseek(file, next_chap_pos, SEEK_SET); 118 fread(buffer, 1, MAX_HEAD_SIZE, file);118 if (0 == fread(buffer, 1, MAX_HEAD_SIZE, file)) break; 119 119 r.buff = buffer; 120 120 r.count = 8; … … 183 183 mpc_demux_seek_sample(demux, 0); 184 184 if (chap_nb > 0) { 185 185 const mpc_chap_info * chap_info = mpc_demux_chap(demux, chap); 186 186 next_chap_sample = chap_info->sample; 187 187 chap_gain = malloc(sizeof(mpc_uint16_t) * 2 * chap_nb); … … 216 216 cur_sample = next_chap_sample; 217 217 if (chap < chap_nb) { 218 218 const mpc_chap_info * chap_info = mpc_demux_chap(demux, chap); 219 219 next_chap_sample = chap_info->sample; 220 220 } else … … 261 261 } 262 262 fseek(file, header_pos[j] - 4, SEEK_SET); 263 fread(buffer, 1, 16, file); 264 if (memcmp(buffer, "MPCK", 4) != 0) {263 264 if (fread(buffer, 1, 16, file) != 16 || memcmp(buffer, "MPCK", 4) != 0) { 265 265 fprintf(stderr, "Unsupported file format, not a sv8 file : %s\n", argv[j + 1]); 266 266 fclose(file); … … 277 277 header_pos[j] += b.size + size; 278 278 fseek(file, header_pos[j], SEEK_SET); 279 fread(buffer, 1, 16, file);279 if (0 == fread(buffer, 1, 16, file)) break; 280 280 r.buff = buffer; 281 281 r.count = 8; … … 287 287 continue; 288 288 } 289 289 header_pos[j] += size; 290 290 291 291 buffer[size] = 1; // replaygain version
Note: See TracChangeset
for help on using the changeset viewer.