if ((pData->bDisplaying) && (pData->bRunning) && (!pData->bFreezing)) {
{
READ_CHUNK (read_endl){#ifdef MNG_SUPPORT_TRACE  MNG_TRACE (pData, MNG_FN_READ_ENDL, 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)  if (iRawlen != 1)                    /* length must be exactly 1 */    MNG_ERROR (pData, MNG_INVALIDLENGTH)#ifdef MNG_SUPPORT_DISPLAY  {    if (pData->bHasLOOP)               /* are we really processing a loop ? */    {      mng_uint8 iLevel = *pRawdata;    /* get the nest level */                                       /* create an ENDL animation object */      mng_retcode iRetcode = create_ani_endl (pData, iLevel);      if (iRetcode)                    /* on error bail out */        return iRetcode;                                       /* process it */      if ((pData->bDisplaying) && (pData->bRunning) && (!pData->bFreezing))      {        mng_ani_endlp pENDL = (mng_ani_endlp)pData->pLastaniobj;        iRetcode = pENDL->sHeader.fProcess (pData, pENDL);        if (iRetcode)                  /* on error bail out */          return iRetcode;      }    }    else    {      /* TODO: error abort ??? */    }  }#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_endlp)*ppChunk)->iLevel = *pRawdata;  }#endif /* MNG_STORE_CHUNKS */#ifdef MNG_SUPPORT_TRACE  MNG_TRACE (pData, MNG_FN_READ_ENDL, MNG_LC_END)#endif  return MNG_NOERROR;                  /* done */}