Add new comment

There is no way to help you

There is no way to help you without 'reproducers'. I need sample file (which definitely hang).

To fully emulate dcraw behavior you need to pass second argument (max_buf_size) to LibRaw::open_file(filename, max_buf_size).
By default, small files are processed using C++ buffered streams (faster), while large files use FILE* internal interface similar to dcraw. Default value of max_buf_size is 250M.
Set it to 0 or 1 and you'll use (slower) FILE* interface for all files.

-- Alex Tutubalin @LibRaw LLC