summaryrefslogtreecommitdiff
path: root/vendor/golang.org/x/image/tiff
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/golang.org/x/image/tiff')
-rw-r--r--vendor/golang.org/x/image/tiff/fuzz.go1
-rw-r--r--vendor/golang.org/x/image/tiff/lzw/reader.go6
-rw-r--r--vendor/golang.org/x/image/tiff/reader.go3
-rw-r--r--vendor/golang.org/x/image/tiff/writer.go3
4 files changed, 10 insertions, 3 deletions
diff --git a/vendor/golang.org/x/image/tiff/fuzz.go b/vendor/golang.org/x/image/tiff/fuzz.go
index ec52c7882..b27c54004 100644
--- a/vendor/golang.org/x/image/tiff/fuzz.go
+++ b/vendor/golang.org/x/image/tiff/fuzz.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build gofuzz
// +build gofuzz
package tiff
diff --git a/vendor/golang.org/x/image/tiff/lzw/reader.go b/vendor/golang.org/x/image/tiff/lzw/reader.go
index 78204ba92..1ccf5858a 100644
--- a/vendor/golang.org/x/image/tiff/lzw/reader.go
+++ b/vendor/golang.org/x/image/tiff/lzw/reader.go
@@ -3,8 +3,8 @@
// license that can be found in the LICENSE file.
// Package lzw implements the Lempel-Ziv-Welch compressed data format,
-// described in T. A. Welch, ``A Technique for High-Performance Data
-// Compression'', Computer, 17(6) (June 1984), pp 8-19.
+// described in T. A. Welch, “A Technique for High-Performance Data
+// Compression”, Computer, 17(6) (June 1984), pp 8-19.
//
// In particular, it implements LZW as used by the TIFF file format, including
// an "off by one" algorithmic difference when compared to standard LZW.
@@ -30,7 +30,7 @@ Aldus "off by one" algorithm.
The Go code doesn't read (invalid) TIFF files written by old versions of
libtiff, but the LZW algorithm in this package still differs from the one in
-Go's standard package library to accomodate this "off by one" in valid TIFFs.
+Go's standard package library to accommodate this "off by one" in valid TIFFs.
*/
import (
diff --git a/vendor/golang.org/x/image/tiff/reader.go b/vendor/golang.org/x/image/tiff/reader.go
index c26ec36bb..de73f4b99 100644
--- a/vendor/golang.org/x/image/tiff/reader.go
+++ b/vendor/golang.org/x/image/tiff/reader.go
@@ -404,6 +404,9 @@ func newDecoder(r io.Reader) (*decoder, error) {
p := make([]byte, 8)
if _, err := d.r.ReadAt(p, 0); err != nil {
+ if err == io.EOF {
+ err = io.ErrUnexpectedEOF
+ }
return nil, err
}
switch string(p[0:4]) {
diff --git a/vendor/golang.org/x/image/tiff/writer.go b/vendor/golang.org/x/image/tiff/writer.go
index c8a01cea7..4272c5aa0 100644
--- a/vendor/golang.org/x/image/tiff/writer.go
+++ b/vendor/golang.org/x/image/tiff/writer.go
@@ -8,6 +8,7 @@ import (
"bytes"
"compress/zlib"
"encoding/binary"
+ "errors"
"image"
"io"
"sort"
@@ -338,6 +339,8 @@ func Encode(w io.Writer, m image.Image, opt *Options) error {
}
case cDeflate:
dst = zlib.NewWriter(&buf)
+ default:
+ return errors.New("tiff: unsupported compression")
}
pr := uint32(prNone)