summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Rasmussen <sebras@gmail.com>2018-02-05 18:26:12 +0100
committerSebastian Rasmussen <sebras@gmail.com>2018-02-06 13:26:13 +0100
commit86b5034359a45254e1f07eca84469db0d44005ad (patch)
treed5f0331f9aa2a66033da7342bafaf2b79f442643
parent90421d4cd157c743264643794a5522a1dd46eda9 (diff)
downloadmupdf-86b5034359a45254e1f07eca84469db0d44005ad.tar.xz
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.
-rw-r--r--source/fitz/draw-unpack.c2
1 files changed, 2 insertions, 0 deletions
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++;
}