DO NOT MERGE Update libpng to 1.6.20

BUG:23265085
Change-Id: I85199805636d771f3597b691b63bc0bf46084833
(cherry picked from commit bbe98b40cda082024b669fa508931042eed18f82)

uarb_inc(uarb num, int in_digits, png_int_32 add)
 /* This is a signed 32-bit add, except that to avoid overflow the value added
    * or subtracted must be no more than 2^31-65536.  A negative result
    * indicates a negative number (which is an error below).  The size of
    * 'num' should be max(in_digits+1,2) for arbitrary 'add' but can be just
    * in_digits+1 if add is known to be in the range -65535..65535.
    */
{
   FIX_GCC int out_digits = 0;

 while (out_digits < in_digits)
 {
      add += num[out_digits];
      num[out_digits++] = (png_uint_16)(add & 0xffff);
      add >>= 16;
 }

 while (add != 0 && add != (-1))
 {
      num[out_digits++] = (png_uint_16)(add & 0xffff);
      add >>= 16;
 }

 if (add == 0)
 {
 while (out_digits > 0 && num[out_digits-1] == 0)
 --out_digits;
 return out_digits; /* may be 0 */
 }

 else /* negative result */
 {
 while (out_digits > 1 && num[out_digits-1] == 0xffff)
 --out_digits;

 return -out_digits;
 }
}

uarb_inc(uarb num, int in_digits, png_int_32 add)
 /* This is a signed 32-bit add, except that to avoid overflow the value added
    * or subtracted must be no more than 2^31-65536.  A negative result
    * indicates a negative number (which is an error below).  The size of
    * 'num' should be max(in_digits+1,2) for arbitrary 'add' but can be just
    * in_digits+1 if add is known to be in the range -65535..65535.
    */
{
   FIX_GCC int out_digits = 0;

 while (out_digits < in_digits)
 {
      add += num[out_digits];
      num[out_digits++] = (png_uint_16)(add & 0xffff);
      add >>= 16;
 }

 while (add != 0 && add != (-1))
 {
      num[out_digits++] = (png_uint_16)(add & 0xffff);
      add >>= 16;
 }

 if (add == 0)
 {
 while (out_digits > 0 && num[out_digits-1] == 0)
 --out_digits;
 return out_digits; /* may be 0 */
 }

 else /* negative result */
 {
 while (out_digits > 1 && num[out_digits-1] == 0xffff)
 --out_digits;

 return -out_digits;
 }
}
