comparison src/aac/libmp4.c @ 2168:3c9527d25346

fix a crash bug in mp4_is_our_file().
author Yoshiki Yazawa <yaz@cc.rim.or.jp>
date Sat, 17 Nov 2007 03:41:41 +0900
parents 4610f14103e4
children 42a5c9d5830b
comparison
equal deleted inserted replaced
2167:d44adaddae8b 2168:3c9527d25346
231 if (parse_aac_stream(file) == TRUE) { 231 if (parse_aac_stream(file) == TRUE) {
232 aud_vfs_fclose(file); 232 aud_vfs_fclose(file);
233 return TRUE; 233 return TRUE;
234 } 234 }
235 if (!memcmp(magic, "ID3", 3)) { // ID3 tag bolted to the front, obfuscated magic bytes 235 if (!memcmp(magic, "ID3", 3)) { // ID3 tag bolted to the front, obfuscated magic bytes
236 aud_vfs_fclose(file); 236 aud_vfs_fclose(file);
237 if (extension &&( 237 if (extension &&(
238 !strcasecmp(extension, ".mp4") || // official extension 238 !strcasecmp(extension, ".mp4") || // official extension
239 !strcasecmp(extension, ".m4a") || // Apple mp4 extension 239 !strcasecmp(extension, ".m4a") || // Apple mp4 extension
240 !strcasecmp(extension, ".aac") // old MPEG2/4-AAC extension 240 !strcasecmp(extension, ".aac") // old MPEG2/4-AAC extension
241 )) 241 ))
242 return 1; 242 return 1;
243 else { 243 else {
244 aud_vfs_fclose(file); 244 return 0;
245 return 0; 245 }
246 }
247 } 246 }
248 if (!memcmp(&magic[4], "ftyp", 4)) { 247 if (!memcmp(&magic[4], "ftyp", 4)) {
249 aud_vfs_fclose(file); 248 aud_vfs_fclose(file);
250 return 1; 249 return 1;
251 } 250 }
252 aud_vfs_fclose(file); 251 aud_vfs_fclose(file);
253 } 252 }
254 return 0; 253 return 0;
255 } 254 }