Commit a414887a authored by Adrian Grange's avatar Adrian Grange

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
parent 7e6cfae9
......@@ -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;
}
......
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