#46 Decoder crashes on illegal ASCII shift sequences

version 0.7.2
decoding (11)

The libdmtx decoder can crash when encountering illegal ASCII shift sequences instead of exiting gracefully with an appropriate error message:

$ dmtxread -v /tmp/iec16022-milan-auto.png
dmtxread: dmtxdecode.c:628: PushOutputWord: Assertion `value >= 0 && value < 256' failed.

This bug shouldn't affect correctly formed barcodes, but can arise when barcodes contain illegal sequences or incorrect Base 256 lengths.


  • dobiasd

    dobiasd - 2013-12-02

    Just ran into this issue with some images.

    At the moment I just commented out line 204 in dmtxdecodescheme.c (//upperShift = DmtxTrue;).

    Is there a better fix/workaround for this?

  • Anonymous - 2014-05-21

    I just encountered this as well. This took down our tomcat server since we're using dmtx with the Java wrapper. Does anyone here have any suggestions for trapping this error within Java? Unfortunately my experience with using c-libs from Java is limited.


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

Sign up for the SourceForge newsletter:

No, thanks