Commit Graph

11 Commits

Author SHA1 Message Date
James Zern
cac9a36a23 gifdec,Remap: avoid out of bounds colormap read
make this function return success/failure.
an empty map or out of bounds read is treated as an error.

BUG=webp:316

Change-Id: Ic8651836915ea4dd8e0dc81ca8d5d3f247be1ff8
2016-11-02 15:01:10 -07:00
James Zern
4595e01fd0 Revert "gifdec,Remap: avoid out of bounds colormap read"
This reverts commit f048d38d38.

the 'len' in Remap refers to the src[] not the colormap; this change
breaks valid files

BUG=webp:316

Change-Id: I1ed40075c2194df91d345cb6f29619b1f5cc96fc
2016-11-01 21:03:56 -07:00
James Zern
fb52d4432a gifdec: make some constants unsigned
fixes implicit type conversion when dealing with color types

Change-Id: Ie4f25e14d8bb2748050db4fca25147164fc6adb4
2016-10-31 17:51:27 -07:00
James Zern
f048d38d38 gifdec,Remap: avoid out of bounds colormap read
sanitize the requested length to be read against the reported size of
the table

BUG=webp:316

Change-Id: I1c471e93ab696a9d21a0142cf1987ffcf8f55dd2
2016-10-31 12:56:04 -07:00
Pascal Massimino
9f5c8eca79 additional fix for stride type as size_t
- remove the inclusion of format_constants.h
 - use incremental update of pointer, instead of arithmetic

(follow-up to e2affacc35)

Change-Id: I48420c8defc8d47339f54bc00e9da9617f08ab32
2016-10-12 18:23:04 +00:00
Pascal Massimino
e2affacc35 fix potential overflow when width * height * 4 >= (1<<32)
Mostly: avoid doing calculation like: ptr + j * stride
when stride is 'int'. Rather use size_t, or pointer increments (ptr += stride)
when possible.

BUG=webp:314

Change-Id: I81c684b515dd1ec4f601f32d50a6e821c4e46e20
2016-10-10 13:55:46 +02:00
hui su
43bd895879 Make gif transparent color to be transparent black
Change it from transparent white to transparent black, which matches
the transparent color assumed in Webp dispose-to-background method.

Also pre-multiply background colors before comparison in anim_diff,
just as what is done with regular pixel values.

Change-Id: I5a790522df21619c666ce499f73e42294ed276f2
2016-09-01 16:50:14 -07:00
James Zern
4077d9447b gifdec: remove utils.h include
though visible WebPCopyPlane & WebPCopyPixels are not part of the public
api; avoid using a private header within this public module.

Change-Id: I5c8615fcc07090ffaa8933b00af418d8431936eb
2015-12-11 19:34:52 -08:00
Urvang Joshi
397863bd66 Refactor CopyPlane() and CopyPixels() methods: put them in utils.
Change-Id: I0e1533df557a0fa42c670e3b826fc0675c36e0a5
2015-11-13 11:39:22 -08:00
Urvang Joshi
feab45ef99 gifdec: Move inclusion of webp/config.h to header.
Given that we are checking GIFLIB_MAJOR etc in the header, we need the
config in header.

Change-Id: I5d502bd67555752a57589a8ce789efcf0945d72e
2015-04-17 12:43:17 -07:00
Urvang Joshi
d1c4ffae89 gif2webp: Move GIF decoding related code to a support library.
Change-Id: Ifa5e663eb0db7e1e08174fe6608bd45950281abb
2015-01-13 17:07:33 -08:00