stb_vorbis: Set error on open_memory with NULL data
"Unexpected EOF" seems like the closest match from the error codes we have. Fixes issue #1123.
This commit is contained in:
parent
0def11ae17
commit
0d47d17002
@ -5100,7 +5100,10 @@ stb_vorbis * stb_vorbis_open_filename(const char *filename, int *error, const st
|
||||
stb_vorbis * stb_vorbis_open_memory(const unsigned char *data, int len, int *error, const stb_vorbis_alloc *alloc)
|
||||
{
|
||||
stb_vorbis *f, p;
|
||||
if (data == NULL) return NULL;
|
||||
if (!data) {
|
||||
if (error) *error = VORBIS_unexpected_eof;
|
||||
return NULL;
|
||||
}
|
||||
vorbis_init(&p, alloc);
|
||||
p.stream = (uint8 *) data;
|
||||
p.stream_end = (uint8 *) data + len;
|
||||
|
Loading…
Reference in New Issue
Block a user