Fix decoding incomplete PNG images

If process_data is unable to read (and therefore process) as many bytes
as it expects, process the bytes read before returning false.

Fixes differences in Gold.

Add a test that verifies that it is okay to call png_process_data with
0 bytes. (We could special case 0, but libpng already checks for 0.)

Change-Id: Id500b9305ee3bb6a1a7e8fc70d4e723cb4742b55
Reviewed-on: https://skia-review.googlesource.com/14144
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Matt Sarett <msarett@google.com>
2 files changed