cyanfish / naps2

Scan documents to PDF and more, as simply as possible.

Home Page:https://www.naps2.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

When using sane to frequently obtain scanner information, an error is reported

hzhappycoder opened this issue · comments

Hello, I am using naps2 and sane on the local linux operating system. Frequently obtain scanner information using a thread. When called around the 7th time, the following error message will appear:

Buffer overflow detected

The complete code is as follows:

for (int i = 0; i < 1000; i++)
{

          Console.WriteLine($"current i : {i}");

          using var scanningContext = new ScanningContext(new GtkImageContext());

          var controller = new ScanController(scanningContext);

          await controller.GetDeviceList(Driver.Sane);
}

Can you try updating to SDK version 0.4.0 and see if that resolves the problem?