Skip to content

image/jpeg: Decoding returns EOF instead of ErrUnexpectedEOF for JPEG files with missing segments #6450

@rakyll

Description

@rakyll
What steps will reproduce the problem?

import (
    "image"
    _ "image/jpeg"
)
img, format, err := image.Decode(jpegImageWithMissingSegmentsReader)


What is the expected output?
Unexpected EOF should be returned.

What do you see instead?
EOF is returned in some cases if there are missing segments in the image file. Attached
file reproduces the problem.

Which operating system are you using?
Darwin Kernel Version 12.4.0

Which version are you using?  (run 'go version')
go version go1.1.2 darwin/386

Attachments:

  1. Stray_Kitten.jpg (131072 bytes)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions