#102 Bug in album art code


I believe to have found an issue with the albumart detection code.

When scanning new folders, minidlna looks for album art and folder covers for each new added path.
With revision 1.30 of albumart.c came a change that effectively provides a handle to a folder to the jpeg library. While this apparently does not matter during production code, when debugging minidlna, gdb shows an error.

The problematic code is in albumart.c on line 293:

snprintf(file, sizeof(file), "%s", path);
art_file = strrchr(file, '.');
if( art_file )
strcpy(art_file, ".jpg");
if( access(file, R_OK) == 0 )
if( art_cache_exists(file, &art_file) )
goto existing_file;
imsrc = image_new_from_jpeg(file, 1, NULL, 0, 1);
if( imsrc )
goto found_file;

I believe the if( access(file, R_OK) == 0 ) block belongs within the if(art_file) block.
Alternatively, minidlna should check if art_file is a file (and not a folder).


  • Justin Maggard

    Justin Maggard - 2011-11-19

    I reworked some code around that area in CVS HEAD. Let me know if that takes care of it for you.

  • Justin Maggard

    Justin Maggard - 2011-11-19
    • assigned_to: nobody --> jmaggard
    • status: open --> open-fixed

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks