Superframe index: Parse correct number of frame sizes

If there are N frames in a superframe, the superframe
index will enumerate the sizes of only the first
(N - 1) frames. The code assumed that all N frame
sizes are coded.

The size of the final frame in the superframe is
calculated as follows:
(data_size - index_size - sum_of_N-1_frame_sizes)

Change-Id: Ia53ae27455a4f024eec311bf7356a00e8e0d449a
This commit is contained in:
Adrian Grange 2016-11-22 15:47:52 -08:00
Родитель 7e6cfae969
Коммит a414887a43
1 изменённых файлов: 3 добавлений и 3 удалений

Просмотреть файл

@ -553,10 +553,10 @@ aom_codec_err_t av1_parse_superframe_index(const uint8_t *data, size_t data_sz,
const uint8_t *x = &data[data_sz - index_sz + 1];
// Frames has a maximum of 8 and mag has a maximum of 4.
uint8_t clear_buffer[32];
assert(sizeof(clear_buffer) >= frames * mag);
uint8_t clear_buffer[28];
assert(sizeof(clear_buffer) >= (frames - 1) * mag);
if (decrypt_cb) {
decrypt_cb(decrypt_state, x, clear_buffer, frames * mag);
decrypt_cb(decrypt_state, x, clear_buffer, (frames - 1) * mag);
x = clear_buffer;
}