AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Low 32 Monero

fix(desktop qr): decode QR images of any PNG bit depth from Select file

Public commit record

What the developer wrote

Authored by sneurlax

95/100 · Strong
fix(desktop qr): decode QR images of any PNG bit depth from Select file

Image.convert(numChannels: 4) keeps the source format, so a 1-bit PNG
(Python qrcode's default output) stayed bit-packed and getBytes returned a
quarter of the bytes RGBLuminanceSource reads. It threw a RangeError, which
was swallowed and reported as "No QR code found". 16-bit PNGs failed the same
way. Convert to 8-bit RGBA, build 0xAARRGGBB pixels explicitly, and
composite transparency onto white. Move the decode into
utilities/qr_image_decoder.dart with tests for 1-bit, 8-bit gray, palette,
16-bit, RGB, RGBA, transparent and JPEG input.
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Uses a recognizable type or scope✓ Provides detailed explanatory context✓ Mentions testing or verification
The short version

What changed, and why it matters

This commit fixes a bug in Stack Wallet's desktop QR code scanner that prevented users from importing QR codes saved as certain types of PNG files (especially small 1-bit black-and-white ones, like those produced by Python's qrcode library). The old code misread the raw image bytes, causing the scanner to silently report 'No QR code found.' The fix converts all incoming images to a standard 8-bit RGBA format before decoding, and adds automated tests for many image formats.

Recommended action

No urgent security action required. This is a reliability/usability fix. Users who previously could not import QR codes from 1-bit or 16-bit PNGs should now be able to. Reviewers may want to verify that the new utility is used consistently across all QR import paths and that the test suite passes.

Security signals we found

01

Fixes a functional bug that caused valid QR codes to be rejected

02

Adds input validation: returns null for non-image bytes and images without QR codes

03

No memory-unsafe operations, network calls, or cryptographic changes observed

04

Refactoring only: no new dependencies introduced

Risk score

Why this scored 32/100

Our methodology →
Potential impact 8/30
Exploitability 3/25
Stealth signal 4/15
Affected reach 6/15
Confidence 7/10
Evidence quality 4/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.