From 86b5034359a45254e1f07eca84469db0d44005ad Mon Sep 17 00:00:00 2001 From: Sebastian Rasmussen Date: Mon, 5 Feb 2018 18:26:12 +0100 Subject: Bug 698989: Throw upon unsupported bpc when unpacking image. Previously mupdf would silently ignore this situation and leave the buffer uninitialized leading to further issues. Thanks to oss-fuzz for reporting. --- source/fitz/draw-unpack.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/fitz/draw-unpack.c b/source/fitz/draw-unpack.c index 2b6a241e..7544c5ac 100644 --- a/source/fitz/draw-unpack.c +++ b/source/fitz/draw-unpack.c @@ -190,6 +190,8 @@ fz_unpack_tile(fz_context *ctx, fz_pixmap *dst, unsigned char * restrict src, in case 16: *dp++ = get16(sp, b); break; case 24: *dp++ = get24(sp, b); break; case 32: *dp++ = get32(sp, b); break; + default: + fz_throw(ctx, FZ_ERROR_GENERIC, "cannot unpack tile with %d bits per component", depth); } b++; } -- cgit v1.2.3