In my opinion:
No matter the image is normal or not ,panic was unexpected.
If the image is normal ,golang need give a normal result.
If the image is abnormal,golang should throw error not panic.
I modified the golang source code image/jpeg/scan.go
for i := 0; i < nComp; i++ {
compIndex := scan[i].compIndex
+ if d.comp[compIndex].tq > maxTq {
+ return FormatError("index is greater than maxTq")
+ }
qt := &d.quant[d.comp[compIndex].tq]
for j := 0; j < d.comp[compIndex].h*d.comp[compIndex].v; j++ {
I use golang contribute ,but i don't know if it works success or not.
jpeg panic
Change-Id: I45d8c88b84c47ac21adc814c25a426fa4aa1d209
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
# On branch needkane
# Your branch is ahead of 'origin/master' by 1 commit.
# (use "git push" to publish your local commits)
#
# Changes to be committed:
# modified: src/image/jpeg/scan.go
#
The text was updated successfully, but these errors were encountered:
Image:
http://s3-us-west-2.amazonaws.com/qiniu-bs/panicImage
In my opinion:
No matter the image is normal or not ,panic was unexpected.
If the image is normal ,golang need give a normal result.
If the image is abnormal,golang should throw error not panic.
I modified the golang source code image/jpeg/scan.go
I use golang contribute ,but i don't know if it works success or not.
jpeg panic
The text was updated successfully, but these errors were encountered: