Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test suite crashes in nearestscale #3

Open
rtandy opened this issue Feb 27, 2012 · 1 comment
Open

test suite crashes in nearestscale #3

rtandy opened this issue Feb 27, 2012 · 1 comment

Comments

@rtandy
Copy link
Collaborator

rtandy commented Feb 27, 2012

The test suite crashes at scale.c:175 in nearestscale. The reason seems to be the way nearestscale is invoked:

        nearestscale(&img, 1280, 1024, 1280, to);

In nearestscale, width and bytesperline are the same which causes jdy to be negative -- or rather, since it's unsigned, positive and very large. At the end of the first outer loop it gets added to newBuf, causing a segfault on the next access to newBuf at line 175.

@andreasbaumann
Copy link
Contributor

vagrind says:

==56796== 1 errors in context 1 of 1:
==56796== Invalid write of size 1
==56796==    at 0x10D096: nearestscale (scale.c:175)
==56796==    by 0x10A760: test_nearestscale (test.c:40)
==56796==    by 0x10A89F: main (test.c:59)
==56796==  Address 0x105206080 is not stack'd, malloc'd or (recently) free'd

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

No branches or pull requests

2 participants