From: Marius Gavrilescu Date: Sat, 24 Sep 2016 20:55:57 +0000 (+0100) Subject: Croak if OpusHead->mapping gets a nonsensical argument X-Git-Tag: 0.004~4 X-Git-Url: http://git.ieval.ro/?a=commitdiff_plain;h=b658996033eac41ec27a1cae2d054cb28c1f4230;p=audio-opusfile.git Croak if OpusHead->mapping gets a nonsensical argument --- diff --git a/Opusfile.xs b/Opusfile.xs index 2f999ac..a8cf872 100644 --- a/Opusfile.xs +++ b/Opusfile.xs @@ -269,8 +269,10 @@ OUTPUT: int mapping(head, k) Audio::Opusfile::Head head; - int k; + unsigned k; CODE: + if(k >= OPUS_CHANNEL_COUNT_MAX) + croak("k must be less than %d\n", (int)OPUS_CHANNEL_COUNT_MAX); RETVAL = (int) head->mapping[k]; OUTPUT: RETVAL