diff options
author | David Robillard <d@drobilla.net> | 2020-06-21 19:57:10 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2020-10-27 13:13:59 +0100 |
commit | 834ca36d4cbbfd63789f7894ab2d5d370347d76f (patch) | |
tree | 36004ae76c4330f7d26408052efc8ef17daa7767 /src | |
parent | b244d0ec5895ff15d52f12704e5f336ad37b4473 (diff) | |
download | serd-834ca36d4cbbfd63789f7894ab2d5d370347d76f.tar.gz serd-834ca36d4cbbfd63789f7894ab2d5d370347d76f.tar.bz2 serd-834ca36d4cbbfd63789f7894ab2d5d370347d76f.zip |
Fix crash when attempting to read before starting
Diffstat (limited to 'src')
-rw-r--r-- | src/byte_source.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/byte_source.c b/src/byte_source.c index 0b233bc9..90af28ee 100644 --- a/src/byte_source.c +++ b/src/byte_source.c @@ -88,6 +88,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) { if (source->page_size > 1) { |