Dealing with NaN pixels

When there are NaN pixels in your render you can either use the value of an adjacent pixel or the average of all adjacent pixels to fix it. The latter will probably give better results, but won’t work when there’s another NaN pixel next to the first one. In an expression node, type: