jhawthorn/meh — Issue #3: test suite crashes in nearestscale
Author: rtandy
Created: 2012-02-27 05:03:47+00:00
State: open

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

```C
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.