1
0
mirror of https://github.com/golang/go synced 2024-11-24 04:50:07 -07:00

image/jpeg: reject multiple Start-Of-Frame markers.

Fixes #10389

Change-Id: Id1c687122751f9317041d9e425d03b267a26c6de
Reviewed-on: https://go-review.googlesource.com/8681
Reviewed-by: Rob Pike <r@golang.org>
This commit is contained in:
Nigel Tao 2015-04-09 11:39:21 +10:00
parent c844bf4cfc
commit eb44082915

View File

@ -298,6 +298,9 @@ func (d *decoder) ignore(n int) error {
// Specified in section B.2.2. // Specified in section B.2.2.
func (d *decoder) processSOF(n int) error { func (d *decoder) processSOF(n int) error {
if d.nComp != 0 {
return FormatError("multiple SOF markers")
}
switch n { switch n {
case 6 + 3*1: // Grayscale image. case 6 + 3*1: // Grayscale image.
d.nComp = 1 d.nComp = 1