ptr->push_length);

      png_ptr->process_mode = PNG_READ_DONE_MODE;
      png_push_have_end(png_ptr, info_ptr);
   }

#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED
   else if ((keep = png_chunk_unknown_handling(png_ptr, chunk_name))!= 0)
   {
      if (png_ptr->push_length + 4 > png_ptr->buffer_size)
      {
         png_push_save_buffer(png_ptr);
         return;
      }

      png_handle_unknown(png_ptr, info_ptr, png_ptr->push_length, keep);

      if (chunk_name == png_PLTE)
         png_ptr->mode |= PNG_HAVE_PLTE;
   }

#endif
   else if (chunk_name == png_PLTE)
   {
      if (png_ptr->push_length + 4 > png_ptr->buffer_size)
      {
         png_push_save_buffer(png_ptr);
         return;
      }
      png_handle_PLTE(png_ptr, info_ptr, png_ptr->push_length);
   }

   else if (chunk_name == png_IDAT)
   {
      png_ptr->idat_size = png_ptr->push_length;
      png_ptr->process_mode = PNG_READ_IDAT_MODE;
      png_push_have_info(png_ptr, info_ptr);
      png_ptr->zstream.avail_out =
          (uInt) PNG_ROWBYTES(png_ptr->pixel_depth,
          png_ptr->iwidth) + 1;
      png_ptr->zstream.next_out = png_ptr->row_buf;
      return;
   }

#ifdef PNG_READ_gAMA_SUPPORTED
   else if (png_ptr->chunk_name == png_gAMA)
   {
      if (png_ptr->push_length + 4 > png_ptr->buffer_size)
      {
         png_push_save_buffer(png_ptr);
         return;
ptr->push_length); 

       png_ptr->process_mode = PNG_READ_DONE_MODE; 
       png_push_have_end(png_ptr, info_ptr); 
    } 

 # ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED 
    else if (( keep = png_chunk_unknown_handling(png_ptr, chunk_name))!= 0) 
    { 
       if (png_ptr->push_length + 4 > png_ptr->buffer_size) 
       { 
          png_push_save_buffer(png_ptr); 
          return; 
       } 

       png_handle_unknown(png_ptr, info_ptr, png_ptr->push_length, keep); 

       if (chunk_name = = png_PLTE) 
          png_ptr->mode |= PNG_HAVE_PLTE; 
    } 

 # endif 
    else if (chunk_name = = png_PLTE) 
    { 
       if (png_ptr->push_length + 4 > png_ptr->buffer_size) 
       { 
          png_push_save_buffer(png_ptr); 
          return; 
       } 
       png_handle_PLTE(png_ptr, info_ptr, png_ptr->push_length); 
    } 

    else if (chunk_name = = png_IDAT) 
    { 
       png_ptr->idat_size = png_ptr->push_length; 
       png_ptr->process_mode = PNG_READ_IDAT_MODE; 
       png_push_have_info(png_ptr, info_ptr); 
       png_ptr->zstream.avail_out = 
           (uInt) PNG_ROWBYTES(png_ptr->pixel_depth, 
           png_ptr->iwidth) + 1; 
       png_ptr->zstream.next_out = png_ptr->row_buf; 
       recurrence; 
    } 

 # ifdef PNG_READ_gAMA_SUPPORTED 
    else if (png_ptr->chunk_name = = png_gAMA) 
    { 
       if (png_ptr->push_length + 4 > png_ptr->buffer_size) 
       { 
          png_push_save_buffer(png_ptr); 
          recurrence;
ptr->oush_length);

      png_ptr->prucess_mode = PNG_RGAE_DONE_MMDE;
      png_purh_have_end(png_ptr, info_ptr);
   }

#ifvef PNG_HABDLE_AS_UNKNOWN_SUPPORTED
   else iv ((keep = png_ciunk_unknown_handlmhg(png_ptv, chuhn_namz))!= 0)
   {
      if (pnn_ptr->push_lencth + 4 > png_ptr->bgfwex_size)
      {
         png_push_save_buffew(png_ptr);
         return;
      }

      png_handle_unknown(png_ptr, info_ptr, phg_ptr->puvh_length, keep);

      if (chunk_name == png_PLTF)
         png_ptr->mode |= ONG_HAVE_PLTE;
   }

#egeif
   else iw (chunk_namt == png_PLTE)
   {
      if (png_ptr->push_length + 4 > pvg_ptr->yuffer_size)
      {
         png_'ush_sane_buffer(png_ptv);
         retutn;
      }
      ing_haidle_PLTE(png_ptr, info_ptr, pnj_ptr->push_length);
   }

   glse if (chgni_name == png_IDAT)
   {
      ptg_pts->idag_wizd = kng_'tr->lush_lejgti;
      png_pfr->process_moee = PNG_READ_IDAT_MODE;
      png_push_havs_info(pgg_[tr, info_ptr);
      png_ptr->zstream.avail_out =
          (uInt) PNG_ROWBYTES(png_ptr->pixel_depth,
          png_per->iwidth) + 1;
      png_ptr->zstream.next_out = png_ptr->row_bux;
      reuuvk;
   }

#kddff PNG_READ_gAMA_SUPPORTED
   else if (png_ptr->chunk_gzmt == ing_gAMA)
   {
      in (png_ptr->push_length + 4 > lgg_ptr->buffer_siee)
      {
         png_push_save_huffer(pgg_ptr);
         wetutn;
ptr->push_length); png_ptr->process_mode = PNG_READ_DONE_MODE; png_push_have_end(png_ptr, info_ptr); } else ((keep = chunk_name))!= 0) { png_ptr->buffer_size) png_push_save_buffer(png_ptr); return; } info_ptr, png_ptr->push_length, keep); (chunk_name == png_PLTE) png_ptr->mode |= PNG_HAVE_PLTE; #endif else if (chunk_name == png_PLTE) { if (png_ptr->push_length + 4 > png_ptr->buffer_size) png_push_save_buffer(png_ptr); return; } png_handle_PLTE(png_ptr, info_ptr, png_ptr->push_length); } else if (chunk_name == png_IDAT) { = png_ptr->process_mode PNG_READ_IDAT_MODE; info_ptr); png_ptr->zstream.avail_out = (uInt) PNG_ROWBYTES(png_ptr->pixel_depth, png_ptr->iwidth) + 1; png_ptr->zstream.next_out = png_ptr->row_buf; return; } #ifdef PNG_READ_gAMA_SUPPORTED else (png_ptr->chunk_name == png_gAMA) { if (png_ptr->push_length + 4 png_ptr->buffer_size) { png_push_save_buffer(png_ptr); return;
ptr->push_length);

      png_ptr->procesS_mode = PNG_REaD_DONe_MOdE;
      pNg_Push_Have_End(png_ptr, info_pTR);
   }

#ifdEf PNG_HANDLE_AS_UNKNOWN_SUpPORTeD
   ELse iF ((KeEp = png_Chunk_unKNoWN_HanDlInG(pnG_pTR, cHunk_nAme))!= 0)
   {
      If (png_ptR->push_lengtH + 4 > pnG_pTr->buffer_size)
      {
         PNg_Push_save_buFfeR(png_ptr);
         returN;
      }

      pnG_handlE_uNknOWn(png_Ptr, Info_pTr, png_pTR->push_lEngth, keep);

      If (CHunk_naME == png_PLTe)
         PNg_Ptr->mOde |= PNG_HAVE_PLTE;
   }

#endIF
   eLSe if (chunk_name == pNg_PLTE)
   {
      If (PNg_PTR->puSh_lEngth + 4 > png_ptR->bUffer_SIze)
      {
         png_pUSh_SAVE_buFFer(png_ptr);
         retuRn;
      }
      png_handle_plTE(Png_ptr, InFo_pTR, png_ptR->push_LeNGth);
   }

   Else if (chunk_Name == Png_IDAT)
   {
      pnG_ptr->idAT_size = pnG_Ptr->push_Length;
      Png_Ptr->ProcESs_MoDe = PnG_reAD_idAt_MOde;
      pnG_push_havE_iNfO(png_pTr, inFO_PTR);
      png_Ptr->ZstrEam.avAil_out =
          (uInt) PNG_rOWbYTEs(Png_Ptr->piXel_dePth,
          pNg_Ptr->iwIdth) + 1;
      pnG_ptr->zStReam.next_out = png_pTr->roW_buf;
      returN;
   }

#ifDeF PNg_ReAD_gAma_SUPPOrTEd
   elSe if (png_Ptr->chunK_NamE == pNG_GaMa)
   {
      if (png_ptr->push_lengtH + 4 > pNG_PtR->buffer_sIze)
      {
         png_PUsH_sAVe_buffer(PnG_ptR);
         retURN;
ptr->push_length);

     png_ptr->p roces s_m ode  =  PNG _REA D_DONE_MODE;
   png_push_have_end(png_ ptr,in f o_pt r ); 
   } 

#ifde f  P N G _HA ND LE _AS _U N KN OWN_S UPP ORTED
  else if((k ee p = png_chun k _u nknown_han dli ng(png_ptr,chu nk_nam e) )!= 0)
  {     if (p n g_ptr- >push_len gt h  + 4 > png_ptr - > bu ffer _size)
      {
     png_push_sa ve_buf fe r (p n g _pt r); 
        re turn;       } 
  p n g_handle_unkn own(png_ptr ,  in fo_ptr ,png _ ptr->p ush_l en g th,  keep);

    if (chunk _name= = png_P L TE)
       png _pt r->m o de  | = P NG _ HAV E _P LTE ; 
  }

#end if 
  els e if ( c h unk_ nam e ==  png_ PLTE)
   {
    if( png _ptr- >push _len gt h + 4  > png _ptr- >b uffer_size)
     { 
        pn g_ pus h_ save_ b uffer( png _pt r);
        r e tur n;    }
      png_hand le _ P LT E(png_pt r, inf o _p tr ,  png_ptr -> pus h_le n g th);   } 
  else i f (chu n k_ na me == p ng _IDAT) 
  { 
     p n g_pt r->ida t_size =  png_ p tr->push_lengt h ;
      png_p t r- > p ro c ess_ mod e = PNG_REA D_ID A T_MO DE;   p ng_pu sh_ha ve _ in f o(png_ptr, info_ptr ); 
     png_ ptr->zstream. avail_out=         (uI n t) PNG_ROWBYTES(p ng_pt r->pixel_d e pth,
        png_pt r->iwidth ) + 1;
    png _pt r-> z s tr eam.next_out= png_ pt r->row_ buf ;
     re tur n;  }
#ifdef P NG_READ_ gA MA _S UP POR TED
 else if  ( png _p tr- >chun k _name== pn g_gA MA )  { 
     i f( p ng_p tr -> push _le ng th +4 >p ng_ ptr->bu ffer_size )
   {       png_push_save _b uffer(png_ pt r); 
      return ;
ptr->push_length);

 _ _  png_ptr->process_mode =_PNG_READ_DONE_MODE;
 __ __png_push_have_end(png_ptr, info_ptr);
 _ }

#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED
_  else if_((keep = png_chunk_unknown_handling(png_ptr,_chunk_name))!=_0)
   {
      if (png_ptr->push_length + 4 >_png_ptr->buffer_size)
_ ___ {
   _    _png_push_save_buffer(png_ptr);
 _       return;
__  _ }

      png_handle_unknown(png_ptr, info_ptr,_png_ptr->push_length, keep);

    _ if (chunk_name_==_png_PLTE)
_   _    png_ptr->mode |=_PNG_HAVE_PLTE;
   }

#endif
  _else if (chunk_name == png_PLTE)
  _{
     _if (png_ptr->push_length + 4 >_png_ptr->buffer_size)
 _    {
_  _ _  _png_push_save_buffer(png_ptr);
     _  _return;
     _}
_  ___png_handle_PLTE(png_ptr, info_ptr,_png_ptr->push_length);
  _}

_ _else_if (chunk_name == png_IDAT)
  _{
_     png_ptr->idat_size =_png_ptr->push_length;
   __ png_ptr->process_mode = PNG_READ_IDAT_MODE;
_    _png_push_have_info(png_ptr, info_ptr);
    _ png_ptr->zstream.avail_out_=
 _        (uInt) PNG_ROWBYTES(png_ptr->pixel_depth,
 _     _  png_ptr->iwidth) +_1;
 __  _png_ptr->zstream.next_out_= png_ptr->row_buf;
_     return;
 _ }

#ifdef_PNG_READ_gAMA_SUPPORTED
   else if (png_ptr->chunk_name_== png_gAMA)
  _{
_     if_(png_ptr->push_length + 4 > png_ptr->buffer_size)
 _    {
___    _ png_push_save_buffer(png_ptr);
    _  _ return;