Go to file
Leon Scroggins III 4993b95f53 Do not create SkGifCodec if true size is not known
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>
2016-12-09 15:04:06 +00:00
animations first cut at a checkbox 2009-10-21 19:41:10 +00:00
bench Revert[2] "remove SK_SUPPORT_LEGACY_CLIP_REGIONOPS" 2016-12-09 14:33:41 +00:00
bin Build for Android from Windows, work in progress. 2016-10-26 14:37:43 +00:00
debugger SkEncodeImage: no more link-time registration 2016-11-30 22:48:56 +00:00
dm Add a context stack to Reporter, for better error messages 2016-12-05 18:30:46 +00:00
example bench, samples, etc: s/SkAutoTUnref/sk_sp/ 2016-11-07 15:17:32 +00:00
experimental [SVGDom] ClipPath support 2016-12-08 15:00:18 +00:00
fuzz Revert[2] "remove SK_SUPPORT_LEGACY_CLIP_REGIONOPS" 2016-12-09 14:33:41 +00:00
gm Revert[2] "remove SK_SUPPORT_LEGACY_CLIP_REGIONOPS" 2016-12-09 14:33:41 +00:00
gn Add the ability to use different mallocs. 2016-12-09 01:21:28 +00:00
gyp [SVGDom] ClipPath support 2016-12-08 15:00:18 +00:00
include Revert[2] "remove SK_SUPPORT_LEGACY_CLIP_REGIONOPS" 2016-12-09 14:33:41 +00:00
infra Update SKP version 2016-12-06 16:51:38 +00:00
platform_tools libviewer.so on Android, delete hello_skia_app 2016-12-08 16:35:25 +00:00
resources Do not create an SkRawCodec with zero dimensions 2016-12-02 22:23:35 +00:00
samplecode Revert[2] "remove SK_SUPPORT_LEGACY_CLIP_REGIONOPS" 2016-12-09 14:33:41 +00:00
site Remove documentation about emboss. 2016-12-08 21:07:46 +00:00
src Do not create SkGifCodec if true size is not known 2016-12-09 15:04:06 +00:00
tests Do not create SkGifCodec if true size is not known 2016-12-09 15:04:06 +00:00
third_party Do not create SkGifCodec if true size is not known 2016-12-09 15:04:06 +00:00
tools Revert[2] "remove SK_SUPPORT_LEGACY_CLIP_REGIONOPS" 2016-12-09 14:33:41 +00:00
.clang-format Add .clang-format file to include/gpu src/gpu 2016-12-08 15:19:15 +00:00
.gitignore Remove skia.conf from .gitignore 2016-10-26 14:50:09 +00:00
.gn Basic standalone GN configs. 2016-07-21 12:25:45 -07:00
AUTHORS Fix typo in GrGLCaps 2016-11-18 23:20:51 +00:00
BUILD.gn libviewer.so on Android, delete hello_skia_app 2016-12-08 16:35:25 +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 Roll GN 2016-12-09 14:30:12 +00:00
Doxyfile Make the housekeeper upload doxygen to a newer bucket 2016-10-04 13:23:57 -07:00
fix-gn-sln.py VS script: Handle variation among configurations 2016-11-21 16:35:39 +00:00
gyp_skia Make Win runtime DLLs writeable before overwriting 2016-03-18 08:33:38 -07:00
gyp_skia.py Roll gyp deps from 1765 to 1796. 2013-11-21 18:11:14 +00:00
LICENSE BUG=skia:5602 2016-09-02 11:19:34 -07:00
make.bat Fix references to https://sites.google.com/site/skiadocs/. 2015-02-03 13:12:54 -02:00
make.py GYP: remove stale skia_scalar gyp variable 2015-11-10 13:25:12 -05:00
Makefile Add visualbench as valid target to Makefile 2015-12-18 08:05:06 -08:00
OWNERS add root files from chrome 2013-08-13 19:11:15 +00:00
PRESUBMIT.py Do not use post upload hooks for 'GOLD_TRYBOT_URL' 2016-11-23 18:34:23 +00:00
public.bzl remove SK_SUPPORT_LEGACY_CLIP_REGIONOPS flag 2016-12-08 20:06:48 +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
skia.gyp Fix references to https://sites.google.com/site/skiadocs/. 2015-02-03 13:12:54 -02:00
whitespace.txt Blame this CL for GTX660 changes. 2016-11-02 22:03:53 +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.