4993b95f53
If there is enough data in the stream to read the reported canvas size, but not enough to read the first image's header, we do not know the true canvas size, since we may expand it to fit the first frame. In that case, return nullptr from NewFromStream. Add a test. SkGifCodec.cpp: Correct a comment - parse returns false if there is a fatal error. parse() returning true does not guarantee that the size was found. Instead of checking the width and height, check to see whether the first frame exists and has its header defined. If not, we do not yet know the true canvas size. Assert that the canvas size is non-zero, which is a fatal error from parse. SkGifImageReader.cpp: Move the code to set the header defined before the SkGIFSizeQuery exit condition. This allows SkGifCodec to check the first frame's header to determine whether the size is known. GifTest.cpp: Add a test which truncates the file just before the image header (and after the global header). Prior to the other changes, this would create an SkCodec. For an image that needs its canvas size expanded, the SkCodec would have an incorrect size. CodecPartialTest.cpp: randPixels.gif now needs more than half of its data to create an SkCodec, so set a minimum for test_partial. Change-Id: I40482f524128b2f1fe59b8f27dd64c7cbe793079 Reviewed-on: https://skia-review.googlesource.com/5701 Reviewed-by: Derek Sollenberger <djsollen@google.com> Commit-Queue: Leon Scroggins <scroggo@google.com> |
||
---|---|---|
.. | ||
angle2 | ||
cpu-features | ||
dng_sdk | ||
etc1 | ||
expat | ||
freetype/include/freetype-android | ||
freetype2 | ||
gif | ||
harfbuzz | ||
icu | ||
jsoncpp | ||
ktx | ||
libjpeg-turbo | ||
libmicrohttpd | ||
libpng | ||
libsdl | ||
libwebp | ||
lua | ||
native_app_glue | ||
piex | ||
sfntly | ||
yasm | ||
zlib | ||
BUILD.gn | ||
README | ||
third_party.gni |
The third_party directory contains a set of dependencies from outside sources that are needed to build various components and tools within Skia. Some of these dependencies reside within the Skia repo, while others are pulled from other repositories and placed in the third_party/externals directory during build. These external dependencies are defined in a DEPS file. Products in third_party are subject to their own respective license terms. The license for each project should be included in the source itself via a license header or file. If the source itself does not include a license header or file, create a README that refers to reliable documentation of the project's license terms on the web.