pData->pJPEGdinfo->client_data = pData;
pData->pJPEGdinfo->client_data  = pData;  if (pData->pJPEGderr2  == MNG_NULL) MNG_ALLOC (pData, pData->pJPEGderr2,  sizeof (mngjpeg_error )) if (pData->pJPEGdsrc2  == MNG_NULL) MNG_ALLOC (pData, pData->pJPEGdsrc2,  sizeof (mngjpeg_source)) if (pData->pJPEGdinfo2 == MNG_NULL) MNG_ALLOC (pData, pData->pJPEGdinfo2, sizeof (mngjpeg_decomp))  pData->pJPEGdinfo2->client_data = pData;
mng_retcode mngjpeg_initialize (mng_datap pData){#ifdef MNG_SUPPORT_TRACE  MNG_TRACE (pData, MNG_FN_JPEG_INITIALIZE, MNG_LC_START)#endif                                       /* allocate space for JPEG structures if necessary */#ifdef MNG_INCLUDE_JNG_READ  if (pData->pJPEGderr  == MNG_NULL)    MNG_ALLOC (pData, pData->pJPEGderr,  sizeof (mngjpeg_error ))  if (pData->pJPEGdsrc  == MNG_NULL)    MNG_ALLOC (pData, pData->pJPEGdsrc,  sizeof (mngjpeg_source))  if (pData->pJPEGdinfo == MNG_NULL)    MNG_ALLOC (pData, pData->pJPEGdinfo, sizeof (mngjpeg_decomp))                                       /* enable reverse addressing */  pData->pJPEGdinfo->client_data = pData;#endif#ifdef MNG_INCLUDE_JNG_WRITE  if (pData->pJPEGcerr  == MNG_NULL)    MNG_ALLOC (pData, pData->pJPEGcerr,  sizeof (mngjpeg_error ))  if (pData->pJPEGcinfo == MNG_NULL)    MNG_ALLOC (pData, pData->pJPEGcinfo, sizeof (mngjpeg_comp  ))                                       /* enable reverse addressing */  pData->pJPEGcinfo->client_data = pData;#endif                                       /* initialize temporary buffer parms */  pData->iJPEGbufmax      = MNG_JPEG_MAXBUF;  MNG_ALLOC (pData, pData->pJPEGbuf, pData->iJPEGbufmax)  pData->pJPEGcurrent     = pData->pJPEGbuf;  pData->iJPEGbufremain   = 0;  pData->pJPEGrow         = MNG_NULL;  pData->iJPEGrowlen      = 0;  pData->iJPEGtoskip      = 0;  pData->bJPEGcompress    = MNG_FALSE; /* not doing anything yet ! */  pData->bJPEGdecompress  = MNG_FALSE;  pData->bJPEGhasheader   = MNG_FALSE;  pData->bJPEGdecostarted = MNG_FALSE;  pData->bJPEGscanstarted = MNG_FALSE;  pData->iJPEGrow         = 0;         /* zero input/output lines */  pData->iJPEGalpharow    = 0;  pData->iJPEGrgbrow      = 0;  pData->iJPEGdisprow     = 0;#ifdef MNG_SUPPORT_TRACE  MNG_TRACE (pData, MNG_FN_JPEG_INITIALIZE, MNG_LC_END)#endif  return MNG_NOERROR;}