#78 Segmentation fault in the second loop

version_0.10
open
nobody
None
5
2013-08-31
2013-08-31
alfa_80
No

Hi,

I am receiving the following crash, mentioning:
/build/buildd/zbar-0.10+doc/zbar/refcnt.h:62: _zbar_refcnt: Assertion `rc >= 0' failed.

I would like to use to detect the position of the patterns finder. For the first loop, it succeeds but when it comes to the second loop, the program crashes there.

The code snippet that is relevent is as follows:

I instatiate 2 objects as private members as below:
zbar::Image zimage;
zbar::ImageScanner scanner;

In the constructor:
zimage.set_size(752, 480);
zimage.set_format("Y800");
scanner.set_config(zbar::ZBAR_QRCODE, zbar::ZBAR_CFG_POSITION, 1);

In the detection function(to detect patterns finder):
std::cout << "Point1.." << std::endl;
//Set image data
zimage.set_data(imageCV.data, imageCV.cols*imageCV.rows);
std::cout << "Points2.." << std::endl; //not detected in the second loop at all
// Scan image
scanner.scan(zimage);

It is important to not that it is not reaching where I output as "Point2" at all in the second loop. I've checked any possible resource management issue, like forgetting to destroy object or similar but I couldn't find, in fact, I didn't use any object in the loop other than ones related to ZBar, even so, all of them are allocated on the stack.

My enviroments are:
ZBar 0.10
Linux Ubuntu 10.04LTS
Intelx86_64

Thanks in advance.

Discussion


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks