summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2018-09-06 01:27:19 +0100
committerCarl Hetherington <cth@carlh.net>2018-09-06 01:27:19 +0100
commit4d3d20687c9e334b29c8a2821e0646fb9166ab3f (patch)
tree1eeb4f9cc532150bfed741a228bc16f763a92681 /src/lib
parent150bd0ec056cad5163818082359b56f55de02cee (diff)
Quell more valgrind warnings.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/image.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/lib/image.cc b/src/lib/image.cc
index b75c0f083..75345cb06 100644
--- a/src/lib/image.cc
+++ b/src/lib/image.cc
@@ -37,6 +37,9 @@ extern "C" {
#include <libavutil/pixdesc.h>
#include <libavutil/frame.h>
}
+#if HAVE_VALGRIND_MEMCHECK_H
+#include <valgrind/memcheck.h>
+#endif
#include <iostream>
#include "i18n.h"
@@ -850,6 +853,12 @@ Image::allocate ()
testing suggests that it works.
*/
_data[i] = (uint8_t *) wrapped_av_malloc (_stride[i] * sample_size(i).height + _extra_pixels * bytes_per_pixel(i) + 32);
+#if HAVE_VALGRIND_MEMCHECK_H
+ /* The data between the end of the line size and the stride is undefined but processed by
+ libswscale, causing lots of valgrind errors. Mark it all defined to quell these errors.
+ */
+ VALGRIND_MAKE_MEM_DEFINED (_data[i], _stride[i] * sample_size(i).height + _extra_pixels * bytes_per_pixel(i) + 32);
+#endif
}
}