ref: 4b1f45e407ad9923e64f2f1a5689290575899f9c
parent: 5e50f1f9a3a488445e76a4a9f00f3cc74fbe8cdf
author: Jean-Marc Valin <[email protected]>
date: Wed Jul 6 18:25:59 EDT 2016
make len==0 return OPUS_INVALID_PACKET rather than OPUS_BAD_ARG for opus_packet_parse_impl() len<0 still returns OPUS_BAD_ARG
--- a/src/opus.c
+++ b/src/opus.c
@@ -201,8 +201,10 @@
opus_int32 pad = 0;
const unsigned char *data0 = data;
- if (size==NULL || len<1)
+ if (size==NULL || len<0)
return OPUS_BAD_ARG;
+ if (len==0)
+ return OPUS_INVALID_PACKET;
framesize = opus_packet_get_samples_per_frame(data, 48000);