From 2fb247d2beb71539ceba8f2841d7c1bad933ab36 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 21 Jun 2020 19:57:10 +0200 Subject: Fix crash when attempting to read before starting --- src/byte_source.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/byte_source.c b/src/byte_source.c index ccdc82e5..ca02ff3e 100644 --- a/src/byte_source.c +++ b/src/byte_source.c @@ -86,6 +86,10 @@ serd_byte_source_open_source(SerdByteSource* source, SerdStatus serd_byte_source_prepare(SerdByteSource* source) { + if (source->page_size == 0) { + return SERD_FAILURE; + } + source->prepared = true; if (source->from_stream) { -- cgit v1.2.1