Skip to content

Protect exposure.histogram from integer overflow#1232

Merged
blink1073 merged 1 commit intoscikit-image:masterfrom
jni:negative-histogram
Nov 25, 2014
Merged

Protect exposure.histogram from integer overflow#1232
blink1073 merged 1 commit intoscikit-image:masterfrom
jni:negative-histogram

Conversation

@jni
Copy link
Copy Markdown
Member

@jni jni commented Nov 24, 2014

Fixes #1228 .

I also removed a min() calculation and prevented an image copy when
offset is 0, which is most of the time.

Fixes scikit-image#1228 .

I also removed a min() calculation and prevented an image copy when
offset is 0, which is most of the time.
@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.01%) when pulling 879f8bb on jni:negative-histogram into 0325d9f on scikit-image:master.

@blink1073
Copy link
Copy Markdown
Contributor

Should we test/update adapthist as well?

@emmanuelle
Copy link
Copy Markdown
Member

thanks @jni ! Looks good to me

@blink1073 equalize_adapthist calls skimage.img_as_uint so we should be fine I guess

@stefanv
Copy link
Copy Markdown
Member

stefanv commented Nov 24, 2014

This looks good to me; @blink1073 if you are happy, please go ahead and merge.

@jni
Copy link
Copy Markdown
Member Author

jni commented Nov 24, 2014

@blink1073 what @emmanuelle said. =P The problem for adapthist is different from this one, because it uses img_as_uint. Yes, we are having a discussion in #1229 about whether our image conversion routines do the right thing, but that's not what this PR addresses.

@blink1073
Copy link
Copy Markdown
Contributor

Okay, okay...

blink1073 added a commit that referenced this pull request Nov 25, 2014
Protect exposure.histogram from integer overflow
@blink1073 blink1073 merged commit 90d8d65 into scikit-image:master Nov 25, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ValueError in exposure.histogram

5 participants