|
@@ -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;
|