JPEGDEC: Fix dither buffer size

This commit is contained in:
Phil Howard 2022-06-09 20:37:41 +01:00
parent d2b065d2da
commit 656d69399a
2 changed files with 2 additions and 1 deletions

View File

@ -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;

View File

@ -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 {