Changeset 436 for libmpc/trunk/mpccut/mpccut.c
- Timestamp:
- 03/07/09 12:42:23 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libmpc/trunk/mpccut/mpccut.c
r427 r436 165 165 166 166 while( memcmp(b.key, "AP", 2) != 0 ) { 167 if ((err = mpc_check_key(b.key)) != MPC_STATUS_OK) { 168 fprintf(stderr, "Error : invalid input stream\n"); 169 goto error; 170 } 167 171 if (memcmp(b.key, "EI", 2) == 0) 168 172 copy_data(in_file, i, e.outputFile, b.size + size); … … 182 186 183 187 while( start_block != 0 ){ 188 if ((err = mpc_check_key(b.key)) != MPC_STATUS_OK) { 189 fprintf(stderr, "Error : invalid input stream\n"); 190 goto error; 191 } 184 192 if (memcmp(b.key, "AP", 2) == 0) 185 193 start_block--; … … 193 201 194 202 while( block_num != 0 ){ 203 if ((err = mpc_check_key(b.key)) != MPC_STATUS_OK) { 204 fprintf(stderr, "Error : invalid input stream\n"); 205 goto error; 206 } 195 207 if (memcmp(b.key, "AP", 2) == 0) { 196 208 if ((e.block_cnt & ((1 << e.seek_pwr) - 1)) == 0) { … … 214 226 writeBlock(&e, "SE", MPC_FALSE, 0); // write end of stream block 215 227 228 error: 216 229 fclose ( e.outputFile ); 217 230 fclose ( in_file ); … … 219 232 mpc_reader_exit_stdio(&reader); 220 233 mpc_encoder_exit(&e); 234 if (err != MPC_STATUS_OK) 235 remove(argv[optind + 1]); 221 236 222 237 return err;
Note: See TracChangeset
for help on using the changeset viewer.