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

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:
2 years, 8 months ago by bsiegert
Modified:
2 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/
2 years, 8 months ago #1
bradfitz
Add the image you created (I assume it's small?) to the test data? On Tue, ...
2 years, 8 months ago #2
bsiegert
On Tue, Jul 26, 2011 at 19:54, Brad Fitzpatrick <bradfitz@golang.org> wrote: > Add the image ...
2 years, 8 months ago #3
bsiegert
Hello nigeltao@golang.org, bradfitz@golang.org (cc: golang-dev@googlegroups.com), Please take another look.
2 years, 8 months ago #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 ...
2 years, 8 months ago #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 ...
2 years, 8 months ago #6
nigeltao
LGTM.
2 years, 8 months ago #7
nigeltao
2 years, 8 months ago #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 1278:e6ce13d99bf5