Commit eb440829 authored by Nigel Tao's avatar Nigel Tao

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

Fixes #10389

Change-Id: Id1c687122751f9317041d9e425d03b267a26c6de
Reviewed-on: https://go-review.googlesource.com/8681Reviewed-by: default avatarRob Pike <r@golang.org>
parent c844bf4c
......@@ -298,6 +298,9 @@ func (d *decoder) ignore(n int) error {
// Specified in section B.2.2.
func (d *decoder) processSOF(n int) error {
if d.nComp != 0 {
return FormatError("multiple SOF markers")
}
switch n {
case 6 + 3*1: // Grayscale image.
d.nComp = 1
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment