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

Issue 4815061: code review 4815061: image/tiff: Do not panic when RowsPerStrip is missing. (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 9 months ago by bsiegert
Modified:
12 years, 8 months ago
Reviewers:
CC:
nigeltao, bradfitz, golang-dev
Visibility:
Public.

Description

image/tiff: Do not panic when RowsPerStrip is missing. The RowsPerStrip tag is mandatory according to the spec. However, Mac OS sometimes (?) omits it. I managed to create such an image by applying "tiffutil -none" on a compressed image. If RowsPerStrip is 0, there was a division by zero in the decoder. Assume that the image is a single strip in this case.

Patch Set 1 #

Patch Set 2 : diff -r 7b7b7ef3e147 https://go.googlecode.com/hg/ #

Patch Set 3 : diff -r 7b7b7ef3e147 https://go.googlecode.com/hg/ #

Patch Set 4 : diff -r 7b7b7ef3e147 https://go.googlecode.com/hg/ #

Patch Set 5 : diff -r 7b7b7ef3e147 https://go.googlecode.com/hg/ #

Patch Set 6 : diff -r 7b7b7ef3e147 https://go.googlecode.com/hg/ #

Total comments: 6

Patch Set 7 : diff -r 7b7b7ef3e147 https://go.googlecode.com/hg/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+29 lines, -0 lines) Patch
M src/pkg/image/tiff/reader.go View 1 4 5 1 chunk +4 lines, -0 lines 0 comments Download
A src/pkg/image/tiff/reader_test.go View 1 2 3 4 5 6 1 chunk +25 lines, -0 lines 0 comments Download
A src/pkg/image/tiff/testdata/no_rps.tiff View 1 2 3 4 5 6 Binary file 0 comments Download

Messages

Total messages: 8
bsiegert
Hello nigeltao@golang.org (cc: golang-dev@googlegroups.com), I'd like you to review this change to https://go.googlecode.com/hg/
12 years, 9 months ago (2011-07-26 17:50:43 UTC) #1
bradfitz
Add the image you created (I assume it's small?) to the test data? On Tue, ...
12 years, 9 months ago (2011-07-26 17:54:30 UTC) #2
bsiegert
On Tue, Jul 26, 2011 at 19:54, Brad Fitzpatrick <bradfitz@golang.org> wrote: > Add the image ...
12 years, 9 months ago (2011-07-26 18:14:13 UTC) #3
bsiegert
Hello nigeltao@golang.org, bradfitz@golang.org (cc: golang-dev@googlegroups.com), Please take another look.
12 years, 9 months ago (2011-07-26 19:40:27 UTC) #4
nigeltao
http://codereview.appspot.com/4815061/diff/3006/src/pkg/image/tiff/reader_test.go File src/pkg/image/tiff/reader_test.go (right): http://codereview.appspot.com/4815061/diff/3006/src/pkg/image/tiff/reader_test.go#newcode12 src/pkg/image/tiff/reader_test.go:12: // This test tries to decode an image that ...
12 years, 9 months ago (2011-07-27 02:22:07 UTC) #5
bsiegert
Thanks for the review. PTAL. http://codereview.appspot.com/4815061/diff/3006/src/pkg/image/tiff/reader_test.go File src/pkg/image/tiff/reader_test.go (right): http://codereview.appspot.com/4815061/diff/3006/src/pkg/image/tiff/reader_test.go#newcode12 src/pkg/image/tiff/reader_test.go:12: // This test tries ...
12 years, 9 months ago (2011-07-27 18:55:12 UTC) #6
nigeltao
LGTM.
12 years, 9 months ago (2011-07-28 01:11:35 UTC) #7
nigeltao
12 years, 9 months ago (2011-07-28 01:17:04 UTC) #8
*** Submitted as http://code.google.com/p/go/source/detail?r=854c7c44697c ***

image/tiff: Do not panic when RowsPerStrip is missing.

The RowsPerStrip tag is mandatory according to the spec. However,
Mac OS sometimes (?) omits it. I managed to create such an image
by applying "tiffutil -none" on a compressed image.

If RowsPerStrip is 0, there was a division by zero in the decoder.
Assume that the image is a single strip in this case.

R=nigeltao, bradfitz
CC=golang-dev
http://codereview.appspot.com/4815061

Committer: Nigel Tao <nigeltao@golang.org>
Sign in to reply to this message.

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