pornel/dssim — pull request #3 by yoavweiss (2012-12-26 11:43:43+00:00)
Title: Work around for out-of-bounds read

Following https://github.com/pornel/dssim/issues/2 I've ran dssim under valgrind and discovered a couple of out-of-bound reads that in fact were the cause of the negative DSSIM score.
I've worked around them here by adding a bounds test before reading.
Since I'm not familiar with the code, there may be a more elegant way to resolve these issues, but this one seems to work.
I no longer get negative DSSIM scores, and the PNGs in question get a DSSIM score of 0, as they should.

I also added a couple of library flags required for linking to pass in Ubuntu 12.04.