Commit 67128662 authored by michael's avatar michael

prevent infinite loop and memcpy of negative amounts

fixes issue194


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@10726 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 7c8d5430
...@@ -67,6 +67,9 @@ static int aac_sync(const uint8_t *buf, int *channels, int *sample_rate, ...@@ -67,6 +67,9 @@ static int aac_sync(const uint8_t *buf, int *channels, int *sample_rate,
skip_bits1(&bits); /* copyright_identification_bit */ skip_bits1(&bits); /* copyright_identification_bit */
skip_bits1(&bits); /* copyright_identification_start */ skip_bits1(&bits); /* copyright_identification_start */
size = get_bits(&bits, 13); /* aac_frame_length */ size = get_bits(&bits, 13); /* aac_frame_length */
if(size < AAC_HEADER_SIZE)
return 0;
skip_bits(&bits, 11); /* adts_buffer_fullness */ skip_bits(&bits, 11); /* adts_buffer_fullness */
rdb = get_bits(&bits, 2); /* number_of_raw_data_blocks_in_frame */ rdb = get_bits(&bits, 2); /* number_of_raw_data_blocks_in_frame */
......
...@@ -114,6 +114,9 @@ static int ac3_sync(const uint8_t *buf, int *channels, int *sample_rate, ...@@ -114,6 +114,9 @@ static int ac3_sync(const uint8_t *buf, int *channels, int *sample_rate,
return 0; /* Currently don't support additional streams */ return 0; /* Currently don't support additional streams */
frmsiz = get_bits(&bits, 11) + 1; frmsiz = get_bits(&bits, 11) + 1;
if(frmsiz*2 < AC3_HEADER_SIZE)
return 0;
fscod = get_bits(&bits, 2); fscod = get_bits(&bits, 2);
if (fscod == 3) { if (fscod == 3) {
fscod2 = get_bits(&bits, 2); fscod2 = get_bits(&bits, 2);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment