History

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.

Michael Niedermayer committed 4 years ago

Commit b4431391 parent 248d9811 file · +3 −0Browse files

Unified · Split

libavcodec/ffv1dec.c+3−0
@@ -187,6 +187,9 @@ static int decode_slice_header(const FFV1Context *f, FFV1Context *fs) · 186 unmodified lines
187187 || (unsigned)fs->slice_y + (uint64_t)fs->slice_height > f->height)
188188 return -1;
189189
190+ if (fs->ac == AC_GOLOMB_RICE && fs->slice_width >= (1<<23))
191+ return AVERROR_INVALIDDATA;
192+
190193 for (i = 0; i < f->plane_count; i++) {
191194 PlaneContext * const p = &fs->plane[i];
192195 int idx = get_symbol(c, state, 0);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t