commit | b89e0a4edd6c0158b24730845e0e498969e22a16 | [log] [tgz] |
---|---|---|
author | Leon Scroggins III <scroggo@google.com> | Fri Nov 13 10:39:39 2020 -0500 |
committer | Leon Scroggins <scroggo@google.com> | Fri Nov 13 20:04:35 2020 +0000 |
tree | c403e90224757d29045f2bbc98989d376db41103 | |
parent | d06d2a6d42baf6c0c91cacc28df2542a911d05fe [diff] |
Fix undefined behavior in libgifcodec SkGifImageReader::parse has a single parameter that is used either to represent a frame index or an SkGIFParseQuery value. It is undefined to cast an out of range integer as an SkGIFParseQuery, so change the parameter to an int, which can be cast to an SkGIFParseQuery. Change-Id: I4b321f117cd8bc969686f3c1c6bf35768644f193 Reviewed-on: https://skia-review.googlesource.com/c/libgifcodec/+/334841 Auto-Submit: Leon Scroggins <scroggo@google.com> Reviewed-by: Julia Lavrova <jlavrova@google.com> Commit-Queue: Leon Scroggins <scroggo@google.com>
libgifcodec is based on a fork of libgif made by Chromium. It was copied into Skia with https://codereview.chromium.org/2045293002, as https://skia.googlesource.com/skia/+/19b91531e912283d237435d94516575b28713cba.
The header file SkGifCodec.h
exposes two functions:
bool SkGifCodec::IsGif(const void*, size_t);
std::unique_ptr<SkCodec> SkGifCodec::MakeFromStream(std::unique_ptr<SkStream>, SkCodec::Result*);
Which can be used by Skia's SkCodec::MakeFromStream
to implement GIF Decoding.
See LICENSE.md
for the license information.