This is done because many babls conversions get optimized by C compilers
to read 16bytes of data at a time. Causing valgrind to report
"Invalid read of size 16" as a false positive. By padding the data at
least when creating conversions we mask the false positives.
conversion->error = 0.0000042;
}
- source = babl_calloc (test_pixels, fmt_source->format.bytes_per_pixel);
+ source = babl_calloc (test_pixels+1, fmt_source->format.bytes_per_pixel);
+ /* +1 is masking valgrind Invalid read of 16
+ * false positives */
destination = babl_calloc (test_pixels, fmt_destination->format.bytes_per_pixel);
ref_destination = babl_calloc (test_pixels, fmt_destination->format.bytes_per_pixel);
destination_rgba_double = babl_calloc (test_pixels, fmt_rgba_double->format.bytes_per_pixel);
}
else
{
- source_float_buf_alloc = babl_malloc (sizeof (float) * n *
+ /* the +1 is to mask a valgrind 'invalid read of size 16' false positive */
+ source_float_buf_alloc = babl_malloc (sizeof (float) * (n+1) *
(BABL (babl->fish.source)->format.model->components));
source_float_buf = source_float_buf_alloc;