QRcode draw_rectangle Crush

Hi,
When I use find_qrcodes to find qrcodes, call draw_rectangle on the LCD screen to draw a rectangle on the LCD screen.
But when running for some time after the OpenMV long green light and then crash. Why is this so?
Will the next version of the firmware update OCR?
I have posted my code with two wrong places, including the one I just described.

Please help.

Thanks

import sensor, image, time, lcd

sensor.reset()
sensor.set_pixformat(sensor.GRAYSCALE)
sensor.set_framesize(sensor.VGA)
sensor.set_windowing((320, 240))
sensor.skip_frames(30)
sensor.set_auto_gain(True)
sensor.set_auto_exposure(True)
sensor.set_auto_whitebal(True)

clock = time.clock()

lcd.init(type = 2)
lcd.set_backlight(1)
lcd.clear()

while(True):
    clock.tick()
    img = sensor.snapshot()
    codes = img.find_qrcodes()
    if codes:
        for code in codes:
            # Green crash
            #img.draw_rectangle(code.rect())
            print(code)
    print(clock.fps())
    # Cant convert to type
    #lcd.display(img)

Hi, use QQVGA2 resolution for the LCD:

sensor.set_framesize(sensor.QQVGA2) # Special 128x160 framesize for LCD Shield.

I noticed a crash with the code that wasn’t there when I first got this working. Um, I’ll fix this in the next firmware release which will be out in about 2 weeks.

This code was solid previously so it must be do to me porting in upstream quirc changes.

Thank you very much for your help

Best regard form China

Hi, this has been fixed in the next release coming out soon. There was a really large stack allocation which was overwriting heap data causing memory corruption in the qrcode. I moved the allocation to the frame buffer stack and the problem went away. Not sure how this worked previously.