dcraw_make_mem_image - no error reported in low memory situation

I'm using LibRaw to decode Sony ARW files.
One option of my code is to allow user to specify they'd like RGB output instead of RGGB.
When this option is chosen I call dcraw_process (result is LIBRAW_SUCCESS), followed by dcraw_make_mem_image with address of my result-code int.

This works great when memory is available.
However, when memory gets tight, this call appears to fail (returns NULL), but the error code is not populated (per "...If caller has passed not-NULL value as errorcode parameter, than *errorcode will be set to error code...").

I'm dealing with the problem, but thought I should report the issue. I was originally only relying on the result-code being LIBRAW_SUCCESS, and was failing to check return value.

Note: It almost looks like this may already be fixed, just not released.

I can't see how that newer code ^ can return NULL without filling in the error value.




After looking at how the code fails in my app, it appears that:

this method is returning an object, but the `data_size` property is 0 (zero).
I guess it is possible that the call to dcraw_process also failed.
I'm going to go back to the debugger and ensure valid data is being presented - I will update when I have confirmed one way or the other.

dcraw_make_mem_image not the cause of problem

Looks like issue is earlier in the process.
One of the load_stream/unpack/dcraw_process is silently failing to allocate some memory, so when it comes to the dcraw_make_mem_image it is being told that width/height/etc are all 0, hence no error, but no return data.

If I can determine where it is failing I'll pass it on, otherwise - feel free to ignore me for now :)