Commit f72b1fea authored by James Almer's avatar James Almer

annexb: ensure that OBU size <= frame size <= TU size

parent 7b454ebb
Pipeline #3400 passed with stages
in 5 minutes and 10 seconds
......@@ -97,11 +97,11 @@ static int annexb_read(AnnexbInputContext *const c, Dav1dData *const data) {
}
if (!c->frame_unit_size) {
res = leb128(c, &c->frame_unit_size);
if (res < 0) return -1;
if (res < 0 || (c->frame_unit_size + res) > c->temporal_unit_size) return -1;
c->temporal_unit_size -= res;
}
res = leb128(c, &len);
if (res < 0) return -1;
if (res < 0 || (len + res) > c->frame_unit_size) return -1;
uint8_t *ptr = dav1d_data_create(data, len);
if (!ptr) return -1;
c->temporal_unit_size -= len + res;
......
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