From 656d69399a998a47b8172f7253a88b47a6f027e9 Mon Sep 17 00:00:00 2001 From: Phil Howard Date: Thu, 9 Jun 2022 20:37:41 +0100 Subject: [PATCH] JPEGDEC: Fix dither buffer size --- libraries/jpegdec/JPEGDEC.cpp | 1 + micropython/modules/jpegdec/jpegdec.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/libraries/jpegdec/JPEGDEC.cpp b/libraries/jpegdec/JPEGDEC.cpp index 5ac0d1d4..fd3c82e0 100644 --- a/libraries/jpegdec/JPEGDEC.cpp +++ b/libraries/jpegdec/JPEGDEC.cpp @@ -192,6 +192,7 @@ int JPEGDEC::decode(int x, int y, int iOptions) return DecodeJPEG(&_jpeg); } /* decode() */ +// TODO PR these tweaks to https://github.com/bitbank2/JPEGDEC int JPEGDEC::decodeDither(int x, int y, uint8_t *pDither, int iOptions) { _jpeg.iXOffset = x; diff --git a/micropython/modules/jpegdec/jpegdec.cpp b/micropython/modules/jpegdec/jpegdec.cpp index 6a124bd3..bc333202 100644 --- a/micropython/modules/jpegdec/jpegdec.cpp +++ b/micropython/modules/jpegdec/jpegdec.cpp @@ -177,7 +177,7 @@ mp_obj_t _JPEG_decode(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args int result = -1; if(self->graphics->graphics->pen_type == PicoGraphics::PEN_P4) { - uint8_t *buf = new uint8_t[1024]; + uint8_t *buf = new uint8_t[2048]; result = self->jpeg->decodeDither(x, y, buf, f); delete[] buf; } else {