]> Cypherpunks repositories - gostls13.git/commit
image/jpeg: don't assume that an ensureNBits failure implies that we can
authorNigel Tao <nigeltao@golang.org>
Mon, 13 Apr 2015 03:25:28 +0000 (13:25 +1000)
committerNigel Tao <nigeltao@golang.org>
Tue, 14 Apr 2015 07:22:44 +0000 (07:22 +0000)
commit2f98bac3107d3dee4f546055e790cf0076454c80
tree87aa5f1202857dabb121945f741c76349bb4dda8
parent8b27d28ed4e74498f04df56bfc25e9feb0422744
image/jpeg: don't assume that an ensureNBits failure implies that we can
call unreadByteStuffedByte.

If ensureNBits was due to an io.EOF that was translated to
jpeg.errShortHuffmanData, then we may have read no bytes, so there is no
byte-stuffed-byte to unread.

Fixes #10387

Change-Id: I39a3842590c6cef2aa48943288d52f603338b44d
Reviewed-on: https://go-review.googlesource.com/8841
Reviewed-by: Rob Pike <r@golang.org>
src/image/jpeg/reader.go
src/image/jpeg/reader_test.go