Add some lrintf() calls to be sure.
authorCarl Hetherington <cth@carlh.net>
Mon, 16 Nov 2020 22:58:53 +0000 (23:58 +0100)
committerCarl Hetherington <cth@carlh.net>
Mon, 16 Nov 2020 23:16:58 +0000 (00:16 +0100)
src/lib/image.cc

index 2d3a4a1d5e0cfb50ef13f2163acaa75e26542afa..9a9fb8c43f12751e614a83c19ad586798cf80d66 100644 (file)
@@ -72,7 +72,7 @@ Image::vertical_factor (int n) const
                throw PixelFormatError ("line_factor()", _pixel_format);
        }
 
-       return pow (2.0f, d->log2_chroma_h);
+       return lrintf(powf(2.0f, d->log2_chroma_h));
 }
 
 int
@@ -87,7 +87,7 @@ Image::horizontal_factor (int n) const
                throw PixelFormatError ("sample_size()", _pixel_format);
        }
 
-       return pow (2.0f, d->log2_chroma_w);
+       return lrintf(powf(2.0f, d->log2_chroma_w));
 }
 
 /** @param n Component index.