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: slice bounds out of range #10395

Closed
dvyukov opened this issue Apr 9, 2015 · 0 comments
Closed

x/image/tiff: slice bounds out of range #10395

dvyukov opened this issue Apr 9, 2015 · 0 comments
Milestone

Comments

@dvyukov
Copy link
Member

dvyukov commented Apr 9, 2015

Run the following program on the following input:

package main

import (
    "bytes"
    "io/ioutil"
    "os"
    "golang.org/x/image/tiff"
)

func main() {
    data, _ := ioutil.ReadFile(os.Args[1])
    img, err := tiff.Decode(bytes.NewReader(data))
    if err != nil {
        return
    }
    var w bytes.Buffer
    err = tiff.Encode(&w, img, nil)
    if err != nil {
        panic(err)
    }
}

https://drive.google.com/file/d/0B20Uwp8Hs1oCMjMwZ0ZpZDE2LTg/view?usp=sharing

It crashes with:

panic: runtime error: slice bounds out of range

goroutine 1 [running]:
runtime.gopanic(0x52ae80, 0xc20800e220)
    src/runtime/panic.go:477 +0x3fe fp=0xc2080414c0 sp=0xc208041440
runtime.panicslice()
    src/runtime/panic.go:18 +0x52 fp=0xc2080414e8 sp=0xc2080414c0
golang.org/x/image/tiff.(*decoder).decode(0xc20807c000, 0x7f6150328380, 0xc2080104c0, 0x0, 0x0, 0x96, 0x67, 0x0, 0x0)
    src/golang.org/x/image/tiff/reader.go:212 +0x3d4 fp=0xc2080416e0 sp=0xc2080414e8
golang.org/x/image/tiff.Decode(0x7f61503282d8, 0xc208014480, 0x7f6150328380, 0xc2080104c0, 0x0, 0x0)
    src/golang.org/x/image/tiff/reader.go:593 +0xadc fp=0xc208041ed0 sp=0xc2080416e0
main.main()
    /tmp/tiff.go:12 +0x132 fp=0xc208041f90 sp=0xc208041ed0

I am on commit 65a798f031fd31a65574938bed2ec44c2bcba496

@dvyukov dvyukov added this to the Go1.5 milestone Apr 9, 2015
@golang golang locked and limited conversation to collaborators Jun 25, 2016
mrhyperbit23z0d added a commit to mrhyperbit23z0d/bhegde8 that referenced this issue Jun 6, 2022
Fixes golang/go#10395

Change-Id: Ice768df7bb0bdac979d49328bfdf0d6713a1e7c3
Reviewed-on: https://go-review.googlesource.com/9264
Reviewed-by: Nigel Tao <nigeltao@golang.org>
GalaxyForcew added a commit to GalaxyForcew/A1bisshy that referenced this issue Jun 6, 2022
Fixes golang/go#10395

Change-Id: Ice768df7bb0bdac979d49328bfdf0d6713a1e7c3
Reviewed-on: https://go-review.googlesource.com/9264
Reviewed-by: Nigel Tao <nigeltao@golang.org>
yi-ge3 added a commit to yi-ge3/wislie that referenced this issue Jun 6, 2022
Fixes golang/go#10395

Change-Id: Ice768df7bb0bdac979d49328bfdf0d6713a1e7c3
Reviewed-on: https://go-review.googlesource.com/9264
Reviewed-by: Nigel Tao <nigeltao@golang.org>
balloontmz6 added a commit to balloontmz6/Likewise42l that referenced this issue Jun 6, 2022
Fixes golang/go#10395

Change-Id: Ice768df7bb0bdac979d49328bfdf0d6713a1e7c3
Reviewed-on: https://go-review.googlesource.com/9264
Reviewed-by: Nigel Tao <nigeltao@golang.org>
snapbakkhfbav added a commit to snapbakkhfbav/SayedBaladohr that referenced this issue Oct 6, 2022
Fixes golang/go#10395

Change-Id: Ice768df7bb0bdac979d49328bfdf0d6713a1e7c3
Reviewed-on: https://go-review.googlesource.com/9264
Reviewed-by: Nigel Tao <nigeltao@golang.org>
MiderWong5ddop added a commit to MiderWong5ddop/sidie88f that referenced this issue Oct 7, 2022
Fixes golang/go#10395

Change-Id: Ice768df7bb0bdac979d49328bfdf0d6713a1e7c3
Reviewed-on: https://go-review.googlesource.com/9264
Reviewed-by: Nigel Tao <nigeltao@golang.org>
rorypeckwnt4v added a commit to rorypeckwnt4v/LearnByBhanuPrataph that referenced this issue Oct 7, 2022
Fixes golang/go#10395

Change-Id: Ice768df7bb0bdac979d49328bfdf0d6713a1e7c3
Reviewed-on: https://go-review.googlesource.com/9264
Reviewed-by: Nigel Tao <nigeltao@golang.org>
egorovcharenko9 added a commit to egorovcharenko9/RiceBIOC470z that referenced this issue Oct 7, 2022
Fixes golang/go#10395

Change-Id: Ice768df7bb0bdac979d49328bfdf0d6713a1e7c3
Reviewed-on: https://go-review.googlesource.com/9264
Reviewed-by: Nigel Tao <nigeltao@golang.org>
RafayGhafoorf added a commit to RafayGhafoorf/dustinsand8 that referenced this issue Oct 7, 2022
Fixes golang/go#10395

Change-Id: Ice768df7bb0bdac979d49328bfdf0d6713a1e7c3
Reviewed-on: https://go-review.googlesource.com/9264
Reviewed-by: Nigel Tao <nigeltao@golang.org>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants