diff options
author | James Almer <jamrial@gmail.com> | 2019-07-06 05:45:52 +0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2019-07-06 05:50:41 +0300 |
commit | 1681028f68f2cff9cd84476b1c1fe74dc715fe4b (patch) | |
tree | 0bed16c49c5dbfc3e7ff9fc8a5225899b3d34037 /src/obu.c | |
parent | e2e56ab916f1b5a4dd302ce9020d5451f8859280 (diff) |
obu: also check frame_size_limit with Frame Header OBUs
Diffstat (limited to 'src/obu.c')
-rw-r--r-- | src/obu.c | 15 |
1 files changed, 8 insertions, 7 deletions
@@ -1297,13 +1297,6 @@ int dav1d_parse_obus(Dav1dContext *const c, Dav1dData *const in, int global) { c->frame_hdr = NULL; return DAV1D_ERR(EINVAL); } - - break; - } - // OBU_FRAMEs shouldn't be signalled with show_existing_frame - if (c->frame_hdr->show_existing_frame) { - c->frame_hdr = NULL; - goto error; } if (c->frame_size_limit && (int64_t)c->frame_hdr->width[1] * @@ -1315,6 +1308,14 @@ int dav1d_parse_obus(Dav1dContext *const c, Dav1dData *const in, int global) { return DAV1D_ERR(ERANGE); } + if (type != OBU_FRAME) + break; + // OBU_FRAMEs shouldn't be signaled with show_existing_frame + if (c->frame_hdr->show_existing_frame) { + c->frame_hdr = NULL; + goto error; + } + // This is the frame header at the start of a frame OBU. // There's no trailing bit at the end to skip, but we do need // to align to the next byte. |