Skip to content

Reading beyond buffer in NarrowWideThreshold() #963

Closed
@janpatera

Description

@janpatera

We have detected that RowReader::NarrowWideThreshold() sometimes reads beyond the data provided by view.
Steps to reproduce:

  1. Adapt ZXingQtReader.cpp to the following:
  auto options = ReaderOptions()
  			 .setTryDownscale(false)
  			 .setTryInvert(false)
  			 .setTextMode(TextMode::HRI)
  			 .setMaxNumberOfSymbols(1);
  1. Add assert(view.isValid()); right to the beginning of RowReader::NarrowWideThreshold() (i.e. line 150 in ODRowReader.h)
  2. Build ZXingQtReader and run it with the attached image
  3. The assert is fired when ITFReader::decodePattern() is called with rowNumber=1560. Then next._size is 4, next._end-next._data is 12, and thus next.subView(4, 10) creates a view extending 2 bytes beyond next._end.

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy