Skip to content

Commit

Permalink
Ensure variadic call is null-terminated
Browse files Browse the repository at this point in the history
  • Loading branch information
kleisauke committed May 25, 2024
1 parent e17bc78 commit 164d308
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions samples/NetVips.Samples/Samples/GenerateImageClass.cs
Original file line number Diff line number Diff line change
Expand Up @@ -776,12 +776,13 @@ private string Generate(string indent = " ")
// remove operations we have to wrap by hand
var exclude = new[]
{
"scale",
"ifthenelse",
"addalpha",
"bandjoin",
"bandrank",
"case",
"composite",
"case"
"ifthenelse",
"scale"
};

// get the list of all nicknames we can generate docstrings for.
Expand Down
2 changes: 1 addition & 1 deletion src/NetVips/Image.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2036,7 +2036,7 @@ public Image AddAlpha()
// use `vips_addalpha` on libvips >= 8.6.
if (NetVips.AtLeastLibvips(8, 6))
{
var result = VipsImage.AddAlpha(this, out var vi);
var result = VipsImage.AddAlpha(this, out var vi, IntPtr.Zero);
if (result != 0)
{
throw new VipsException("unable to append alpha channel to image.");
Expand Down
2 changes: 1 addition & 1 deletion src/NetVips/Internal/Vips.cs
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ internal static extern IntPtr NewFromMemoryCopy(IntPtr data, UIntPtr size, int w
[SuppressUnmanagedCodeSecurity]
[DllImport(Libraries.Vips, CallingConvention = CallingConvention.Cdecl,
EntryPoint = "vips_addalpha")]
internal static extern int AddAlpha(Image image, out IntPtr @out);
internal static extern int AddAlpha(Image image, out IntPtr @out, IntPtr args);

[SuppressUnmanagedCodeSecurity]
[DllImport(Libraries.Vips, CallingConvention = CallingConvention.Cdecl,
Expand Down

0 comments on commit 164d308

Please sign in to comment.