Commit graph

7 commits

Author SHA1 Message Date
Alexandre Perrin
21f6863577 Added a row_average member to struct quirc.
Prep to remove the VLA from threshold()
2017-06-11 10:08:58 +02:00
Alexandre Perrin
971c9d4e8c refactor quirc_resize
So that the given quirc struct is never invalid once we return to the
caller.
2017-06-09 22:12:06 +02:00
Alexandre Perrin
1f9edb0b84 Fix a potential use-after-free on quirc_resize failure.
Before this patch, in the event of `q->image` reallocation success but
`q->pixels` failure, `q->image` would point to a freed memory.

After this patch, once quirc_resize() returns, `q->image` consistently
point to a memory address that can be freed.

There is still an inconsistency left in the example codepath: `q->{h,w}`
would hold the "old" values, while `q->image` allocated size would be
based in the requested width/height; hence the comment update about the
state of the QR-code recognizer (it should only be passed to
quirc_destroy()).
2017-06-07 19:37:14 +02:00
Daniel Beer
3c31aa0987 Fix potential leak on allocation failure in quirc_resize(). 2017-05-18 19:29:02 +12:00
Alexandre Perrin
3a6efb3d84 Large images decoding support
Fix #2, this patch makes large images support a compile time option by
allowing QUIRC_MAX_REGIONS to be tuned via CFLAGS up to 65534 (current
default is 254).
2016-07-15 14:40:40 +02:00
Daniel Beer
c8b1861b8f quirc_strerror: fix off by one error.
Bug reported by Harald Eilertsen (http://github.com/snake66/).
2013-02-02 18:04:49 +13:00
Daniel Beer
a3142bc6b4 Initial commit: version 1.0. 2012-05-04 12:58:42 +12:00