if (iRetcode)                       return iRetcode;  if ((pData->bDisplaying) && (pData->bRunning) && (!pData->bFreezing)) {
if (!iRetcode)
READ_CHUNK (read_dhdr){  mng_uint8 iImagetype, iDeltatype;#ifdef MNG_SUPPORT_TRACE  MNG_TRACE (pData, MNG_FN_READ_DHDR, MNG_LC_START)#endif  if (!pData->bHasMHDR)                /* sequence checks */    MNG_ERROR (pData, MNG_SEQUENCEERROR)#ifdef MNG_INCLUDE_JNG  if ((pData->bHasIHDR) || (pData->bHasBASI) || (pData->bHasDHDR) || (pData->bHasJHDR))#else  if ((pData->bHasIHDR) || (pData->bHasBASI) || (pData->bHasDHDR))#endif    MNG_ERROR (pData, MNG_SEQUENCEERROR)                                       /* check for valid length */  if ((iRawlen != 4) && (iRawlen != 12) && (iRawlen != 20))    MNG_ERROR (pData, MNG_INVALIDLENGTH)  iImagetype = *(pRawdata+2);          /* check fields for validity */  iDeltatype = *(pRawdata+3);  if (iImagetype > MNG_IMAGETYPE_JNG)    MNG_ERROR (pData, MNG_INVIMAGETYPE)  if (iDeltatype > MNG_DELTATYPE_NOCHANGE)    MNG_ERROR (pData, MNG_INVDELTATYPE)  if ((iDeltatype == MNG_DELTATYPE_REPLACE) && (iRawlen > 12))    MNG_ERROR (pData, MNG_INVALIDLENGTH)  if ((iDeltatype == MNG_DELTATYPE_NOCHANGE) && (iRawlen > 4))    MNG_ERROR (pData, MNG_INVALIDLENGTH)  pData->bHasDHDR = MNG_TRUE;          /* inside a DHDR-IEND block now */  pData->iImagelevel++;                /* one level deeper */#ifdef MNG_SUPPORT_DISPLAY  {    mng_uint16  iObjectid    = mng_get_uint16 (pRawdata);    mng_uint32  iBlockwidth  = 0;    mng_uint32  iBlockheight = 0;    mng_uint32  iBlockx      = 0;    mng_uint32  iBlocky      = 0;    mng_retcode iRetcode;    if (iRawlen > 4)    {      iBlockwidth  = mng_get_uint32 (pRawdata+4);      iBlockheight = mng_get_uint32 (pRawdata+8);    }    if (iRawlen > 12)    {      iBlockx      = mng_get_uint32 (pRawdata+12);      iBlocky      = mng_get_uint32 (pRawdata+16);    }    iRetcode = create_ani_dhdr (pData, iObjectid, iImagetype, iDeltatype,                                iBlockwidth, iBlockheight, iBlockx, iBlocky);    if (iRetcode)                      /* on error bail out */      return iRetcode;                                       /* display processing ? */    if ((pData->bDisplaying) && (pData->bRunning) && (!pData->bFreezing))    {      iRetcode = process_display_dhdr (pData, iObjectid, iImagetype, iDeltatype,                                       iBlockwidth, iBlockheight, iBlockx, iBlocky);      if (iRetcode)                    /* on error bail out */        return iRetcode;    }  }#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_dhdrp)*ppChunk)->iObjectid      = mng_get_uint16 (pRawdata);    ((mng_dhdrp)*ppChunk)->iImagetype     = iImagetype;    ((mng_dhdrp)*ppChunk)->iDeltatype     = iDeltatype;    if (iRawlen > 4)    {      ((mng_dhdrp)*ppChunk)->iBlockwidth  = mng_get_uint32 (pRawdata+4);      ((mng_dhdrp)*ppChunk)->iBlockheight = mng_get_uint32 (pRawdata+8);    }    if (iRawlen > 12)    {      ((mng_dhdrp)*ppChunk)->iBlockx      = mng_get_uint32 (pRawdata+12);      ((mng_dhdrp)*ppChunk)->iBlocky      = mng_get_uint32 (pRawdata+16);    }  }#endif /* MNG_STORE_CHUNKS */#ifdef MNG_SUPPORT_TRACE  MNG_TRACE (pData, MNG_FN_READ_DHDR, MNG_LC_END)#endif  return MNG_NOERROR;                  /* done */}