Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/videolan/dav1d.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src/obu.c
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2019-07-06 05:45:52 +0300
committerJames Almer <jamrial@gmail.com>2019-07-06 05:50:41 +0300
commit1681028f68f2cff9cd84476b1c1fe74dc715fe4b (patch)
tree0bed16c49c5dbfc3e7ff9fc8a5225899b3d34037 /src/obu.c
parente2e56ab916f1b5a4dd302ce9020d5451f8859280 (diff)
obu: also check frame_size_limit with Frame Header OBUs
Diffstat (limited to 'src/obu.c')
-rw-r--r--src/obu.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/obu.c b/src/obu.c
index 147887b..2c095ae 100644
--- a/src/obu.c
+++ b/src/obu.c
@@ -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.