From 528aeb3bf3e42c235f5822de04b16778d284a7df Mon Sep 17 00:00:00 2001 From: Damien George Date: Mon, 27 Feb 2017 18:39:35 +1100 Subject: [PATCH] drivers/display/lcd160cr: Add check that JPEG size is less than 65536. --- drivers/display/lcd160cr.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/display/lcd160cr.py b/drivers/display/lcd160cr.py index d63dc39759..0cf52f2ef3 100644 --- a/drivers/display/lcd160cr.py +++ b/drivers/display/lcd160cr.py @@ -446,6 +446,8 @@ class LCD160CR: self._send(s) def jpeg_start(self, l): + if l > 0xffff: + raise ValueError('length must be 65535 or less') self.oflush() self._fcmd2('