Logged In: YES
user_id=587529
Originator: YES

After some more debugging, the following seems to be the cause:

The function readpgm(char, pix, int) is called a first time, when the image to analyse is loaded. After that the database is starting to load. But since the f1 referenc in this method is static, it is not NULL when calling the method for the first database item. But since the file handler for the first image was closed and the method returned, the address still stored in f1 is now invalid.

I added a "f1=NULL" in line 384 of pnm.c which seems to fix the issue for me. However I don't quite get the point of making f1 static, so perhaps some could explain that. Or someone could test if the insertion of this line will not break anything else.