<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im"><span style="color:rgb(34,34,34)">It would be simpler to remove the p_dec member first. It is not really</span><br>
</div>
needed.</blockquote></div><div class="gmail_extra"><br></div>I do not understand quietly how it could be implemented.</div><div class="gmail_extra">jpeg_std_error function requires jpeg_error_mgr structure as input. Unlike libpng's user_error_fn it doesn't allow to pass custom user data.</div>
<div class="gmail_extra">As far as I understand C, as jpeg_error_mgr is first attribute in decoder_sys_t/encoder_sys_t structure, it allows us to cast one to another and vice versa.</div><div class="gmail_extra">In the same time decoder_sys_t is not first attribute in decoder_t, so we can't cast decoder_t to jpeg_error_mgr, and cast it from jpeg_error_mgr to decoder_t inside error handling function.</div>
<div class="gmail_extra">If I'm mistaken, please, correct me.</div><div class="gmail_extra"><br clear="all"><div><br></div>-- <br>Maxim Bublis
</div></div>