Please refer Issue 35 of Leptotica: http://code.google.com/p/leptonica/issues/detail?id=35
pixRead for gif have a potential problem related to closing file stream (fclose) that depends on OS. The problem has been fixed for windows (win32) as shown in Issue 35, but I guess the same problem still exists for OSX. I also meet the same problem when building .NET (not win32) application with Leptotica.