* @author Alex Beregszaszi
*/
-#define ALT_BITSTREAM_READER_LE
+#define BITSTREAM_READER_LE
//#define DEBUG
#include <limits.h>
#include "avcodec.h"
s->data_length = get_bits_long(&s->gb, 32);
skip_bits(&s->gb, 32); // CRC32 of header
+ if (s->channels == 0) {
+ av_log(s->avctx, AV_LOG_ERROR, "Invalid number of channels\n");
+ return AVERROR_INVALIDDATA;
+ }
+
switch(s->bps) {
case 2:
avctx->sample_fmt = AV_SAMPLE_FMT_S16;
// decode directly to output buffer for 24-bit sample format
if (s->bps == 3)
- s->decode_buffer = data;
+ s->decode_buffer = s->frame.data[0];
// init per channel states
for (i = 0; i < s->channels; i++) {