if (pData->bDisplaying)
READ_CHUNK (read_splt){  mng_uint8p pTemp;  mng_uint32 iNamelen;  mng_uint8  iSampledepth;  mng_uint32 iRemain;#ifdef MNG_SUPPORT_TRACE  MNG_TRACE (pData, MNG_FN_READ_SPLT, MNG_LC_START)#endif                                       /* sequence checks */  if ((!pData->bHasMHDR) && (!pData->bHasIHDR) &&      (!pData->bHasBASI) && (!pData->bHasDHDR)    )    MNG_ERROR (pData, MNG_SEQUENCEERROR)  if (pData->bHasIDAT)    MNG_ERROR (pData, MNG_SEQUENCEERROR)  if (iRawlen)  {    pTemp = find_null (pRawdata);      /* find null-separator */                                       /* not found inside input-data ? */    if ((pTemp - pRawdata) > (mng_int32)iRawlen)      MNG_ERROR (pData, MNG_NULLNOTFOUND)    iNamelen     = (mng_uint32)(pTemp - pRawdata);    iSampledepth = *(pTemp+1);    iRemain      = (iRawlen - 2 - iNamelen);    if ((iSampledepth != 1) && (iSampledepth != 2))      MNG_ERROR (pData, MNG_INVSAMPLEDEPTH)                                       /* check remaining length */    if ( ((iSampledepth == 1) && (iRemain %  6 != 0)) ||         ((iSampledepth == 2) && (iRemain % 10 != 0))    )      MNG_ERROR (pData, MNG_INVALIDLENGTH)  }  else  {    pTemp        = MNG_NULL;    iNamelen     = 0;    iSampledepth = 0;    iRemain      = 0;  }#ifdef MNG_SUPPORT_DISPLAY  if (pData->bDisplaying)  {    /* TODO: something !!! */  }#endif /* MNG_SUPPORT_DISPLAY */#ifdef MNG_STORE_CHUNKS  if (pData->bStorechunks)  {                                    /* initialize storage */    mng_retcode iRetcode = ((mng_chunk_headerp)pHeader)->fCreate (pData, pHeader, ppChunk);    if (iRetcode)                      /* on error bail out */      return iRetcode;                                       /* store the fields */    ((mng_spltp)*ppChunk)->bEmpty = (mng_bool)(iRawlen == 0);    if (iRawlen)    {      ((mng_spltp)*ppChunk)->iNamesize    = iNamelen;      ((mng_spltp)*ppChunk)->iSampledepth = iSampledepth;      if (iSampledepth == 1)        ((mng_spltp)*ppChunk)->iEntrycount = iRemain / 6;      else        ((mng_spltp)*ppChunk)->iEntrycount = iRemain / 10;      if (iNamelen)      {        MNG_ALLOC (pData, ((mng_spltp)*ppChunk)->zName, iNamelen+1)        MNG_COPY (((mng_spltp)*ppChunk)->zName, pRawdata, iNamelen)      }      if (iRemain)      {        MNG_ALLOC (pData, ((mng_spltp)*ppChunk)->pEntries, iRemain)        MNG_COPY (((mng_spltp)*ppChunk)->pEntries, pTemp+2, iRemain)      }    }  }#endif /* MNG_STORE_CHUNKS */#ifdef MNG_SUPPORT_TRACE  MNG_TRACE (pData, MNG_FN_READ_SPLT, MNG_LC_END)#endif  return MNG_NOERROR;                  /* done */}