From 41fa3c52e3f72dec250ef1ced9935a4b5730032e Mon Sep 17 00:00:00 2001 From: David Rose Date: Fri, 18 Oct 2019 12:50:52 -0700 Subject: [PATCH] further fix to pfmFile.resize() --- panda/src/pnmimage/pnm-image-filter-sparse-core.cxx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/panda/src/pnmimage/pnm-image-filter-sparse-core.cxx b/panda/src/pnmimage/pnm-image-filter-sparse-core.cxx index 49336dd301..abfa2017cd 100644 --- a/panda/src/pnmimage/pnm-image-filter-sparse-core.cxx +++ b/panda/src/pnmimage/pnm-image-filter-sparse-core.cxx @@ -69,7 +69,6 @@ FUNCTION_NAME(IMAGETYPE &dest, const IMAGETYPE &source, filter, filter_width, actual_width); for (a = 0; a < dest.ASIZE(); a++) { - nassertv(!isnan(temp_dest[a]) && !isnan(temp_dest_weight[a])); matrix[a][b] = temp_dest[a]; matrix_weight[a][b] = temp_dest_weight[a]; } @@ -95,10 +94,10 @@ FUNCTION_NAME(IMAGETYPE &dest, const IMAGETYPE &source, filter, filter_width, actual_width); for (b = 0; b < dest.BSIZE(); b++) { - nassertv(!isnan(temp_dest[b]) && !isnan(temp_dest_weight[b])); if (temp_dest_weight[b] != 0) { - dest.SETVAL(a, b, channel, (float)temp_dest[b]/(float)temp_dest_weight[b]); - nassertv(!isnan(dest.GETVAL(a, b, channel))); + // The temp_dest array has already been scaled by + // temp_dest_weight; we don't scale it again here. + dest.SETVAL(a, b, channel, (float)temp_dest[b]/(float)source_max); } } }