Go to file
Leon Scroggins III e56774602c Fix truncated webp images
Bug: b/65290323

If a webp file is truncated such that no rows can be decoded,
WebPIDecGetRGB does not initialize its "last_y" parameter. We use
rowsDecoded (passed as last_y) to determine which remaining rows to
fill.

Check the return value of WebPIDecGetRGB. If it fails (returns null),
or rowsDecoded is <= 0 (matching Chromium's check), return
kInvalidInput, since there is nothing to draw.

Note that this is a change in behavior for Android. Previously we
would decode an empty webp to just a transparent/black rectangle,
whereas now we simply fail. I think this is a change for the better.

Add a test which truncates a file to have 0 rows available and attempts
to decode it. msan verifies that we no longer depend on the
uninitialized value.

Stop attempting to test decoding subsets from an incomplete webp (in
CodecTest.cpp). Unless we have decoded the portion covered by the
subset, this will fail.

Remove test images inc0.webp (from both dm/ and colorspace/) and
inc1.webp. These just decode to transparent rectangles. Replace them
with inc2.webp and inc3.webp, which decode part of the image and then
have to fill with transparent.

Change-Id: I64d40be91c574b45963f9a43d8dd8f4929dd2939
Reviewed-on: https://skia-review.googlesource.com/50303
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: James Zern <jzern@google.com>
2017-09-27 20:51:02 +00:00
animations first cut at a checkbox 2009-10-21 19:41:10 +00:00
bench guard old apis for querying byte-size of a bitmap/imageinfo/pixmap 2017-09-27 14:36:07 +00:00
bin add a Win/Clang build bot 2017-07-31 19:53:51 +00:00
debugger Revert "Revert "Revert "Revert "Remove GrBackendRenderTargetDesc in favor of GrBackendRenderTarget."""" 2017-08-31 20:04:12 +00:00
dm guard old apis for querying byte-size of a bitmap/imageinfo/pixmap 2017-09-27 14:36:07 +00:00
docs feedback 2017-09-21 16:50:10 +00:00
example More iOS Fixes for SkiaSDLExample. 2017-09-05 20:34:55 +00:00
experimental Fix SkSVGDOM length & presentation context scoping 2017-09-09 14:06:28 +00:00
fuzz Fuzz: use SkNullWStream 2017-08-29 17:41:36 +00:00
gm Revert "Revert "migrate to sk_sp for SkFontMgr API"" 2017-09-26 14:05:18 +00:00
gn guard old apis for querying byte-size of a bitmap/imageinfo/pixmap 2017-09-27 14:36:07 +00:00
include guard old apis for querying byte-size of a bitmap/imageinfo/pixmap 2017-09-27 14:36:07 +00:00
infra Fix truncated webp images 2017-09-27 20:51:02 +00:00
platform_tools Enable ios on Raspberry Pi 2017-04-25 16:56:41 +00:00
resources Add animated cowboy sample from WebKit tests, and fix. 2017-09-25 21:14:09 +00:00
samplecode guard old apis for querying byte-size of a bitmap/imageinfo/pixmap 2017-09-27 14:36:07 +00:00
site Update Skia trooper page 2017-09-27 15:17:48 +00:00
src Fix truncated webp images 2017-09-27 20:51:02 +00:00
tests Fix truncated webp images 2017-09-27 20:51:02 +00:00
third_party corrected spirv tools output file name 2017-09-25 13:28:29 +00:00
tools Remove unused functions get_preferred_size 2017-09-26 20:02:16 +00:00
.clang-format Mark flatennable macros as block beginning/ending in .clang-format 2017-01-09 15:31:36 +00:00
.gitignore clang on windows support 2017-07-31 18:39:23 +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 [WASM] Add POC compile bot for WebAssembly 2017-09-21 18:24:43 +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 skia/third_party/externals/angle2/ f0fd87d82..457ded9b4 (1 commit) 2017-09-25 23:36:19 +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 Manually roll recipe DEPS 2017-09-27 17:24:38 +00:00
public.bzl guard old apis for querying byte-size of a bitmap/imageinfo/pixmap 2017-09-27 14:36:07 +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 Revert "Whitespace change to test Android autoroller" 2017-09-07 15:25:02 +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.