comparison imc.c @ 6332:f2c6708aebf9 libavcodec

Check that we have enough input data in IMC decoder.
author reimar
date Tue, 05 Feb 2008 18:39:55 +0000
parents 195356fc7230
children 48759bfbd073
comparison
equal deleted inserted replaced
6331:c57670e07668 6332:f2c6708aebf9
636 int flag; 636 int flag;
637 int bits, summer; 637 int bits, summer;
638 int counter, bitscount; 638 int counter, bitscount;
639 uint16_t buf16[IMC_BLOCK_SIZE / 2]; 639 uint16_t buf16[IMC_BLOCK_SIZE / 2];
640 640
641 if (buf_size < IMC_BLOCK_SIZE) {
642 av_log(avctx, AV_LOG_ERROR, "imc frame too small!\n");
643 return -1;
644 }
641 for(i = 0; i < IMC_BLOCK_SIZE / 2; i++) 645 for(i = 0; i < IMC_BLOCK_SIZE / 2; i++)
642 buf16[i] = bswap_16(((const uint16_t*)buf)[i]); 646 buf16[i] = bswap_16(((const uint16_t*)buf)[i]);
643 647
644 init_get_bits(&q->gb, (const uint8_t*)buf16, IMC_BLOCK_SIZE * 8); 648 init_get_bits(&q->gb, (const uint8_t*)buf16, IMC_BLOCK_SIZE * 8);
645 649