Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/image/{tiff,bmp}: EOF instead of UnexpectedEOF #11391

Closed
dvyukov opened this issue Jun 24, 2015 · 1 comment
Closed

x/image/{tiff,bmp}: EOF instead of UnexpectedEOF #11391

dvyukov opened this issue Jun 24, 2015 · 1 comment
Labels
FrozenDueToAge help wanted NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@dvyukov
Copy link
Member

dvyukov commented Jun 24, 2015

The following program prints EOF, which looks weird (whole image decoded?). Jpeg and png print UnexpectedEOF in this case. Tiff should also return UnexpectedEOF. The same for bmp package.

package main

import (
    "bytes"
    "fmt"
    "golang.org/x/image/tiff"
)

func main() {
    _, err := tiff.Decode(bytes.NewReader([]byte{}))
    fmt.Printf("err: %v\n", err)
}

on commit eb11b45157c1b71f30b3cec66306f1cd779a689e
go version devel +3cab476 Sun Jun 21 03:11:01 2015 +0000 linux/amd64

@ianlancetaylor ianlancetaylor added this to the Unreleased milestone Jul 11, 2015
@bcmills bcmills added help wanted NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Aug 19, 2019
oneslash pushed a commit to oneslash/image that referenced this issue Nov 5, 2019
bmp: should return io.UnexpectedEOF on empty data

fixing: golang/go#11391
oneslash added a commit to oneslash/image that referenced this issue Nov 5, 2019
bmp: should return io.UnexpectedEOF on empty data

fixing: golang/go#11391
@gopherbot
Copy link
Contributor

Change https://golang.org/cl/205458 mentions this issue: tiff, bmp: return io.UnexpectedEOF on empty data

@golang golang locked and limited conversation to collaborators Dec 5, 2020
GalaxyForcew added a commit to GalaxyForcew/A1bisshy that referenced this issue Jun 6, 2022
Check for an EOF when decoding the tiff and bmp headers,
so that decoding empty data does not return an EOF.

Fixes golang/go#11391

Change-Id: I73394b9dcc0d2e4e2a7bc56addb3f690791820ba
GitHub-Last-Rev: 924636fca185e34399b558c92c1d4b80f43eadfc
GitHub-Pull-Request: golang/image#3
Reviewed-on: https://go-review.googlesource.com/c/image/+/205458
Run-TryBot: Akhil Indurti <[email protected]>
TryBot-Result: Gobot Gobot <[email protected]>
Reviewed-by: Akhil Indurti <[email protected]>
Reviewed-by: Nigel Tao <[email protected]>
yi-ge3 added a commit to yi-ge3/wislie that referenced this issue Jun 6, 2022
Check for an EOF when decoding the tiff and bmp headers,
so that decoding empty data does not return an EOF.

Fixes golang/go#11391

Change-Id: I73394b9dcc0d2e4e2a7bc56addb3f690791820ba
GitHub-Last-Rev: 924636fca185e34399b558c92c1d4b80f43eadfc
GitHub-Pull-Request: golang/image#3
Reviewed-on: https://go-review.googlesource.com/c/image/+/205458
Run-TryBot: Akhil Indurti <[email protected]>
TryBot-Result: Gobot Gobot <[email protected]>
Reviewed-by: Akhil Indurti <[email protected]>
Reviewed-by: Nigel Tao <[email protected]>
snapbakkhfbav added a commit to snapbakkhfbav/SayedBaladohr that referenced this issue Oct 6, 2022
Check for an EOF when decoding the tiff and bmp headers,
so that decoding empty data does not return an EOF.

Fixes golang/go#11391

Change-Id: I73394b9dcc0d2e4e2a7bc56addb3f690791820ba
GitHub-Last-Rev: 924636fca185e34399b558c92c1d4b80f43eadfc
GitHub-Pull-Request: golang/image#3
Reviewed-on: https://go-review.googlesource.com/c/image/+/205458
Run-TryBot: Akhil Indurti <[email protected]>
TryBot-Result: Gobot Gobot <[email protected]>
Reviewed-by: Akhil Indurti <[email protected]>
Reviewed-by: Nigel Tao <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge help wanted NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants