]> iEval git - audio-opusfile.git/commitdiff
Croak if OpusHead->mapping gets a nonsensical argument
authorMarius Gavrilescu <marius@ieval.ro>
Sat, 24 Sep 2016 20:55:57 +0000 (21:55 +0100)
committerMarius Gavrilescu <marius@ieval.ro>
Sat, 24 Sep 2016 20:55:57 +0000 (21:55 +0100)
Opusfile.xs

index 2f999ac8ab7c3144230a3ef1d3adae23fafb1e85..a8cf872bc3218ff1b33c71939818a65170f3508a 100644 (file)
@@ -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
This page took 0.028619 seconds and 4 git commands to generate.