Fix bug #45775 (Infinite loop on nonexistent texture file)