Ok, it was just a stupid programmation error. I was using strrchr(fn, '/')+1, so when '/' was not found, strrchr was returning NULL, and I was playing with address 1. When the camera starts the function was called with empty string => buffer overflow sometimes when the resulting string is too long, as I wasn't taking any precaution. So now it's fixed, and I took precautions. Should be ok. I attached the svn-diff (I'm learning...) against juciphox-427 (I also included the script-title menu modification).
Sorry for this...