# HG changeset patch # User vitor # Date 1184741147 0 # Node ID e0b7c248c33ee8227750f4e4a9dab3a2e450d942 # Parent 3c0a5cb7fc6bf0f5742f56d82eb8124de9bacabb Test for supported number of channels diff -r 3c0a5cb7fc6b -r e0b7c248c33e alac.c --- 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?