rEFIt_UEFI/libeg/lodepng.cpp
/* data size argument is in bytes. Returns error if size too large causing overflow */
data size argument is in bytes. Returns error if size too large causing overflow
data size argument is in bytes . Returns error if size too large causing overflow
static unsigned LodePNGBitReader_init(LodePNGBitReader* reader, const unsigned char* data, size_t size) {
  size_t temp;
  reader->data = data;
  reader->size = size;
  if(lodepng_mulofl(size, 8u, &reader->bitsize)) return 105;
  if(lodepng_addofl(reader->bitsize, 64u, &temp)) return 105;
  reader->bp = 0;
  reader->buffer = 0;
  return 0; 
}
static unsigned LodePNGBitReader_init ( LodePNGBitReader * reader , const unsigned char * data , size_t size ) { size_t temp ; reader -> data = data ; reader -> size = size ; if ( lodepng_mulofl ( size , 8u , & reader -> bitsize ) ) return 105 ; if ( lodepng_addofl ( reader -> bitsize , 64u , & temp ) ) return 105 ; reader -> bp = 0 ; reader -> buffer = 0 ; return 0 ; }
data size argument is in bytes.
data size argument is in bytes .
/* size in bits, return error if overflow (if size_t is 32 bit this supports up to 500MB)  */ /*ensure incremented bp can be compared to bitsize without overflow even when it would be incremented 32 too much and
  trying to ensure 32 more bits*/ /*ok*/