In the command line tool make sure that the compressed image is valid before trying to calculate its PSNR.

This commit is contained in:
Pavel Krajcevski 2012-09-18 22:33:18 -04:00
parent 78da9499ec
commit 3cac6ae464

View file

@ -83,6 +83,10 @@ int main(int argc, char **argv) {
settings.iNumCompressions = numCompressions;
CompressedImage *ci = CompressImage(file, settings);
if(NULL == ci) {
fprintf(stderr, "Error compressing image!\n");
return 1;
}
double PSNR = ComputePSNR(*ci, file);
if(PSNR > 0.0) {
@ -93,7 +97,6 @@ int main(int argc, char **argv) {
}
// Cleanup
if(NULL != ci)
delete ci;
return 0;