+1  A: 

205 is 0xCD, that is the standard value put by VS in debug mode in unitialized memory, so I think that your cinfo was not initialized properly at the moment you've called the decoder. Post the code when you use it.

Also, the setjump() you're using make me think it's IJG library. Be careful with it because it's not a standard function. It remembers the exact state of the thread and stack when you've made the call and is able to return to that position from anywhere, except cases when this state is not valid anymore, as in:

int init_fn(){
     if (setjump(my_state)){
        // ERROR!
     };
return 0;
};

int decode(){
     init_fn();
     do_work();
};

here the saved state is not valid at the time you call the actual decoder. For MT case you have to call the setjump() from the same thread as longjmp().

ruslik
Yes, it's the IJG library. I'll look deeper into these things and post when I have any news, thanks a lot !
BlueCookie
Just edited the original post. I don't think I'm trying to call setjmp() and longjmp() from different functions/threads. (Not being a C or CRT expert, this problem is quite confusing...)
BlueCookie
Thanks for the hint about cinfo - even if the problem persisted later on, it was the actual answer.
BlueCookie
A: 

Found the answer to my problem, partly thanks to ruslik. Turns out that I was indeed badly initializing cinfo and jerr between the two functions.

But when I corrected this point, I still had the "state 205" error and thought it was at the same place. Digging in my logs, I found the error message to be issued later in the code execution, and caused by problems with function pointers. My own ugly mistake...

Thanks a lot anyway !

BlueCookie