summaryrefslogtreecommitdiff
path: root/src/repacketizer.c
diff options
context:
space:
mode:
authorJean-Marc Valin <jmvalin@jmvalin.ca>2016-07-04 01:29:23 -0400
committerJean-Marc Valin <jmvalin@jmvalin.ca>2016-07-04 01:29:23 -0400
commit328953e1896432bc700b9b5c69ae2987c5d752f4 (patch)
tree10f574c6f6e3c42644728f352747ce97d78171ea /src/repacketizer.c
parentf6f8487b76f234437e7d4c2831e630d9d06cb074 (diff)
downloadopus-328953e1896432bc700b9b5c69ae2987c5d752f4.tar.gz
Making calls to opus_packet_pad() on a bad packet return OPUS_INVALID_PACKET
We were previously returning OPUS_BAD_ARG because the failure was only detected in opus_repacketizer_out_range_impl() rather than in opus_repacketizer_cat(). Checking the return value from opus_repacketizer_cat() also addresses the last outstanding Coverity defect.
Diffstat (limited to 'src/repacketizer.c')
-rw-r--r--src/repacketizer.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/repacketizer.c b/src/repacketizer.c
index f27e9ab9..c80ee7f0 100644
--- a/src/repacketizer.c
+++ b/src/repacketizer.c
@@ -249,7 +249,9 @@ int opus_packet_pad(unsigned char *data, opus_int32 len, opus_int32 new_len)
opus_repacketizer_init(&rp);
/* Moving payload to the end of the packet so we can do in-place padding */
OPUS_MOVE(data+new_len-len, data, len);
- opus_repacketizer_cat(&rp, data+new_len-len, len);
+ ret = opus_repacketizer_cat(&rp, data+new_len-len, len);
+ if (ret != OPUS_OK)
+ return ret;
ret = opus_repacketizer_out_range_impl(&rp, 0, rp.nb_frames, data, new_len, 0, 1);
if (ret > 0)
return OPUS_OK;