* Fix segfault when encountering a certain type of corrupted embedded JPEG image on audio files.

This commit is contained in:
Justin Maggard 2009-04-10 22:25:04 +00:00
parent 90069678a7
commit 0303f15fa4
2 changed files with 6 additions and 0 deletions

View File

@ -126,6 +126,8 @@ check_embedded_art(const char * path, const char * image_data, int image_size)
} }
imsrc = image_new_from_jpeg(NULL, 0, image_data, image_size); imsrc = image_new_from_jpeg(NULL, 0, image_data, image_size);
if( !imsrc )
return NULL;
width = imsrc->width; width = imsrc->width;
height = imsrc->height; height = imsrc->height;

View File

@ -653,10 +653,14 @@ main(int argc, char * * argv)
{ {
DPRINTF(E_FATAL, L_GENERAL, "ERROR: Failed to create sqlite database! Exiting...\n"); DPRINTF(E_FATAL, L_GENERAL, "ERROR: Failed to create sqlite database! Exiting...\n");
} }
#if USE_FORK
if( pthread_create(&thread[0], NULL, start_scanner, NULL) ) if( pthread_create(&thread[0], NULL, start_scanner, NULL) )
{ {
DPRINTF(E_FATAL, L_GENERAL, "ERROR: pthread_create() failed for start_scanner.\n"); DPRINTF(E_FATAL, L_GENERAL, "ERROR: pthread_create() failed for start_scanner.\n");
} }
#else
start_scanner();
#endif
} }
sqlite3_free_table(result); sqlite3_free_table(result);
} }