changeset 5362:e0b7c248c33e libavcodec

Test for supported number of channels
author vitor
date Wed, 18 Jul 2007 06:45:47 +0000
parents 3c0a5cb7fc6b
children 1a25f2f6316e
files alac.c
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/alac.c	Wed Jul 18 06:27:37 2007 +0000
+++ b/alac.c	Wed Jul 18 06:45:47 2007 +0000
@@ -491,6 +491,11 @@
     init_get_bits(&alac->gb, inbuffer, input_buffer_size * 8);
 
     channels = get_bits(&alac->gb, 3) + 1;
+    if (channels > MAX_CHANNELS) {
+        av_log(avctx, AV_LOG_ERROR, "channels > %d not supported\n",
+               MAX_CHANNELS);
+        return input_buffer_size;
+    }
 
     /* 2^result = something to do with output waiting.
      * perhaps matters if we read > 1 frame in a pass?