From 290dd0b4263370ec53a89fa5a71cbf423d9b5741 Mon Sep 17 00:00:00 2001 From: James Zern Date: Sat, 14 Dec 2019 20:43:15 +0000 Subject: [PATCH] muxread: fix 0 offset of NULL pointer BUG=chromium:1028620,chromium:1027409 Change-Id: I2b5527a223a03161afbf39c297c4646954a91fbc --- src/mux/muxread.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mux/muxread.c b/src/mux/muxread.c index 268f6acb..ae3b876b 100644 --- a/src/mux/muxread.c +++ b/src/mux/muxread.c @@ -100,7 +100,7 @@ static int MuxImageParse(const WebPChunk* const chunk, int copy_data, WebPMuxImage* const wpi) { const uint8_t* bytes = chunk->data_.bytes; size_t size = chunk->data_.size; - const uint8_t* const last = bytes + size; + const uint8_t* const last = (bytes == NULL) ? NULL : bytes + size; WebPChunk subchunk; size_t subchunk_size; WebPChunk** unknown_chunk_list = &wpi->unknown_;