Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(3886)

Issue 7486051: code review 7486051: image/gif: handle invalid GIFs more cautiously (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 1 month ago by jeff.allen
Modified:
11 years, 1 month ago
Reviewers:
nigeltao, r, mtj1, minux1, bradfitz
CC:
golang-dev
Visibility:
Public.

Description

image/gif: handle invalid GIFs more cautiously GIFs with huge bounds and not enough pixels to match were causing huge allocations before giving an error. We now load the pixels and compare how many are really available before allocating the image. Fixes issue 5050.

Patch Set 1 #

Patch Set 2 : diff -r 773d3583bac6 http://code.google.com/p/go #

Total comments: 2

Patch Set 3 : diff -r 773d3583bac6 http://code.google.com/p/go #

Total comments: 3

Patch Set 4 : diff -r 773d3583bac6 http://code.google.com/p/go #

Unified diffs Side-by-side diffs Delta from patch set Stats (+26 lines, -10 lines) Patch
M src/pkg/image/decode_test.go View 1 2 3 1 chunk +8 lines, -0 lines 0 comments Download
M src/pkg/image/gif/reader.go View 1 2 3 4 chunks +18 lines, -10 lines 0 comments Download
A src/pkg/image/testdata/issue5050.gif View 1 Binary file 0 comments Download

Messages

Total messages: 13
jeff.allen
Hello nigeltao@golang.org (cc: golang-dev@googlegroups.com), I'd like you to review this change to http://code.google.com/p/go
11 years, 1 month ago (2013-03-14 15:26:47 UTC) #1
r
There may be something to do here, but I don't believe you've done it. https://codereview.appspot.com/7486051/diff/2001/src/pkg/image/decode_test.go ...
11 years, 1 month ago (2013-03-14 15:48:41 UTC) #2
bradfitz
The problem was that you could make a GIF file that said: [ header ] ...
11 years, 1 month ago (2013-03-14 16:36:59 UTC) #3
mtj1
precisely... the "GIF of death" much larger than: https://commons.wikimedia.org/wiki/Category:Very_large_GIF_files You might want to think of ...
11 years, 1 month ago (2013-03-14 17:06:40 UTC) #4
jeff.allen
Hello nigeltao@golang.org, r@golang.org, bradfitz@golang.org, mtj@google.com (cc: golang-dev@googlegroups.com), Please take another look.
11 years, 1 month ago (2013-03-14 17:22:48 UTC) #5
r
i had the problem backwards. looks good but please fix these two nits. https://codereview.appspot.com/7486051/diff/10001/src/pkg/image/decode_test.go File ...
11 years, 1 month ago (2013-03-14 17:44:20 UTC) #6
r
https://codereview.appspot.com/7486051/diff/10001/src/pkg/image/gif/reader.go File src/pkg/image/gif/reader.go (right): https://codereview.appspot.com/7486051/diff/10001/src/pkg/image/gif/reader.go#newcode189 src/pkg/image/gif/reader.go:189: return fmt.Errorf("gif: not enough pixels") actually this isn't a ...
11 years, 1 month ago (2013-03-14 17:45:40 UTC) #7
jeff.allen
Hello nigeltao@golang.org, r@golang.org, bradfitz@golang.org, mtj@google.com (cc: golang-dev@googlegroups.com), Please take another look.
11 years, 1 month ago (2013-03-15 08:30:37 UTC) #8
minux1
could we use a smaller gif for the test? i think we can just take ...
11 years, 1 month ago (2013-03-15 08:37:59 UTC) #9
nigeltao
On 2013/03/14 16:36:59, bradfitz wrote: > [ header ] [ image is 99999999 x 99999999 ...
11 years, 1 month ago (2013-03-15 08:42:41 UTC) #10
nigeltao
On Fri, Mar 15, 2013 at 7:42 PM, <nigeltao@golang.org> wrote: > Some more thought is ...
11 years, 1 month ago (2013-03-15 11:17:41 UTC) #11
nigeltao
On Fri, Mar 15, 2013 at 7:42 PM, <nigeltao@golang.org> wrote: > Some more thought is ...
11 years, 1 month ago (2013-03-15 11:18:00 UTC) #12
jeff.allen
11 years, 1 month ago (2013-03-15 16:19:23 UTC) #13
Please see https://codereview.appspot.com/7602045/ for a better solution to
issue 5050.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b