if (!pData->bHasJHDR)
if ((!pData->bHasJHDR) && (!pData->bHasDHDR))
READ_CHUNK (read_jdat){#ifdef MNG_SUPPORT_TRACE  MNG_TRACE (pData, MNG_FN_READ_JDAT, MNG_LC_START)#endif  if (!pData->bHasJHDR)                /* sequence checks */    MNG_ERROR (pData, MNG_SEQUENCEERROR)  if (iRawlen == 0)                    /* can never be empty */    MNG_ERROR (pData, MNG_INVALIDLENGTH)  pData->bHasJDAT = MNG_TRUE;          /* got some JDAT now, don't we */#ifdef MNG_SUPPORT_DISPLAY  if (iRawlen)  {                                    /* display processing for non-empty chunks */    mng_retcode iRetcode = process_display_jdat (pData, iRawlen, pRawdata);    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_jdatp)*ppChunk)->bEmpty    = (mng_bool)(iRawlen == 0);    ((mng_jdatp)*ppChunk)->iDatasize = iRawlen;    if (iRawlen != 0)                  /* is there any data ? */    {      MNG_ALLOC (pData, ((mng_jdatp)*ppChunk)->pData, iRawlen)      MNG_COPY  (((mng_jdatp)*ppChunk)->pData, pRawdata, iRawlen)    }  }#endif /* MNG_STORE_CHUNKS */#ifdef MNG_SUPPORT_TRACE  MNG_TRACE (pData, MNG_FN_READ_JDAT, MNG_LC_END)#endif  return MNG_NOERROR;                  /* done */}