Go to file
Leon Scroggins 434b6e81a5 Revert "Make SkPngCodec only read as much of the stream as necessary"
This reverts commit 2c65d51612.

Reason for revert: Causing failures in Google3 (https://test.corp.google.com/ui#cl=153703311&flags=CAMQAg==&id=OCL:153703311:BASE:153703364:1492695824938:4db2240d&t=//chrome/skia/dm_wrapper:dm_wrapper) and differences in Gold. This change was not intended to change the output.

Original change's description:
> Make SkPngCodec only read as much of the stream as necessary
> 
> Previously, SkPngCodec assumed that the stream only contained one
> image, which ended at the end of the stream. It read the stream in
> arbitrarily-sized chunks, and then passed that data to libpng for
> processing.
> 
> If a stream contains more than one image, this may result in reading
> beyond the end of the image, making future reads read the wrong data.
> 
> Now, SkPngCodec starts by reading 8 bytes at a time. After the
> signature, 8 bytes is enough to know which chunk is next and how many
> bytes are in the chunk.
> 
> When decoding the size, we stop when we reach IDAT, and when decoding
> the image, we stop when we reach IEND.
> 
> This manual parsing is necessary to support APNG, which is planned in
> the future. It also allows us to remove the SK_GOOGLE3_PNG_HACK, which
> was a workaround for reading more than necessary at the beginning of
> the image.
> 
> Add a test that simulates the issue, by decoding a special stream that
> reports an error if the codec attempts to read beyond the end.
> 
> Temporarily disable the partial decoding tests for png. A larger change
> will be necessary to get those working again, and no clients are
> currently relying on incrementally decoding PNGs (i.e. decode part of
> an image, then decode further with more data).
> 
> Bug: skia:5368
> BUG:34073812
> 
> Change-Id: If832f7b20565411226fb5be3c305a4d16bf9269d
> Reviewed-on: https://skia-review.googlesource.com/13900
> Commit-Queue: Leon Scroggins <scroggo@google.com>
> Reviewed-by: Matt Sarett <msarett@google.com>
> 

TBR=msarett@google.com,scroggo@google.com,reviews@skia.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: I2f82e9960dda7bf5c646774df84320dadb7b930e
Reviewed-on: https://skia-review.googlesource.com/13971
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2017-04-20 15:07:23 +00:00
animations first cut at a checkbox 2009-10-21 19:41:10 +00:00
bench hide lockpixels api behind flag 2017-04-17 15:33:36 +00:00
bin bin/fetch-clang-format 2017-03-08 16:43:49 +00:00
debugger Get Debugger app compiling again 2017-01-06 16:18:27 +00:00
dm Switch SkCodec to int for counts and indices 2017-04-17 17:38:35 +00:00
example Add the ability to enable/disable GPU path renderers 2017-02-22 20:29:56 +00:00
experimental Move the ability to access textures, buffers, and image storages out from GrProcessor. 2017-04-04 15:27:44 +00:00
fuzz hide lockpixels api behind flag 2017-04-17 15:33:36 +00:00
gm Revert "Plumb GrBackendTexture throughout skia." 2017-04-19 00:23:50 +00:00
gn Revert "Make SkPngCodec only read as much of the stream as necessary" 2017-04-20 15:07:23 +00:00
include Remove all config conversion modes except round-to-nearest 2017-04-20 15:03:19 +00:00
infra Recipes: remove some pragma: no cover 2017-04-19 19:14:46 +00:00
platform_tools One-liner fix that allows Viewer to switch between Raster and OpenGL 2017-02-23 22:33:36 +00:00
resources Add a test for getFrameInfo on truncated data 2017-04-17 16:35:35 +00:00
samplecode hide lockpixels api behind flag 2017-04-17 15:33:36 +00:00
site Document the new bug and test lines behavior of the release rollers 2017-04-18 12:20:57 +00:00
src Revert "Make SkPngCodec only read as much of the stream as necessary" 2017-04-20 15:07:23 +00:00
tests Revert "Make SkPngCodec only read as much of the stream as necessary" 2017-04-20 15:07:23 +00:00
third_party Check-in vulkan.h into third_party and use that instead of local sdk vulkan.h 2017-04-20 13:09:27 +00:00
tools Check-in vulkan.h into third_party and use that instead of local sdk vulkan.h 2017-04-20 13:09:27 +00:00
.clang-format Mark flatennable macros as block beginning/ending in .clang-format 2017-01-09 15:31:36 +00:00
.gitignore Refactor Vulkan support to support Fuchsia 2017-04-05 17:32:09 +00:00
.gn Basic standalone GN configs. 2016-07-21 12:25:45 -07:00
AUTHORS Added support for building for tvOS 2017-03-14 22:55:04 +00:00
BUILD.gn Check-in vulkan.h into third_party and use that instead of local sdk vulkan.h 2017-04-20 13:09:27 +00:00
codereview.settings Make uploading to Gerrit the default for Skia 2016-11-09 19:07:56 +00:00
CONTRIBUTING Fix references to https://sites.google.com/site/skiadocs/. 2015-02-03 13:12:54 -02:00
CQ_COMMITTERS Moved committer list to chrome-infra-auth and deleted it from the repo 2015-09-02 13:37:54 -07:00
DEPS Update build tools to newer gn. 2017-03-17 17:38:58 +00:00
Doxyfile Make the housekeeper upload doxygen to a newer bucket 2016-10-04 13:23:57 -07:00
LICENSE BUG=skia:5602 2016-09-02 11:19:34 -07:00
PRESUBMIT.py Change PRESUBMIT.py to use [Get|Update]DescriptionLines 2017-04-05 12:49:32 +00:00
public.bzl Revert "remove legacy flags from google3" 2017-04-19 11:47:22 +00:00
README Fix references to https://sites.google.com/site/skiadocs/. 2015-02-03 13:12:54 -02:00
README.chromium Update README.chromium. 2015-06-11 13:19:24 -07:00
whitespace.txt Marker for driver update on Win10 Golo GT610 2017-03-29 14:07:18 +00:00

Skia is a complete 2D graphic library for drawing Text, Geometries, and Images.

See full details, and build instructions, at https://skia.org.