diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2022-07-03 14:31:19 +0300 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2022-09-01 01:41:28 +0300 |
commit | 89685f280a6b256f798788a7b463daeddf8bf631 (patch) | |
tree | 7b5614de93a3e9b1596044164a4114190b85a2fe | |
parent | b5fc01adbe66147767bab98533c9b8bcd784484f (diff) |
avcodec/ffv1dec: Limit golomb rice coded slices to width 8M
This limit is possibly not reachable due to other restrictions on buffers but
the decoder run table is too small beyond this, so explicitly check for it.
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit b4431399ec1e10afff458cf1ffae2a75987d725a)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/ffv1dec.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/ffv1dec.c b/libavcodec/ffv1dec.c index 810b2e18f0..9c2cb37f63 100644 --- a/libavcodec/ffv1dec.c +++ b/libavcodec/ffv1dec.c @@ -185,6 +185,9 @@ static int decode_slice_header(const FFV1Context *f, FFV1Context *fs) || (unsigned)fs->slice_y + (uint64_t)fs->slice_height > f->height) return -1; + if (fs->ac == AC_GOLOMB_RICE && fs->slice_width >= (1<<23)) + return AVERROR_INVALIDDATA; + for (i = 0; i < f->plane_count; i++) { PlaneContext * const p = &fs->plane[i]; int idx = get_symbol(c, state, 0); |