History

avcodec/ffv1dec: Check that num h/v slices is supported

Fixes: out of array access Fixes: 55597/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FFV1_fuzzer-4898293416329216

Michael Niedermayer committed 3 years ago

Commit 8ead0ae1 parent a02e45a1 file · +5 −0Browse files

Unified · Split

libavcodec/ffv1dec.c+5−0
@@ -475,6 +475,11 @@ static int read_extra_header(FFV1Context *f) · 474 unmodified lines
475475 return AVERROR_INVALIDDATA;
476476 }
477477
478+ if (f->num_h_slices > MAX_SLICES / f->num_v_slices) {
479+ av_log(f->avctx, AV_LOG_ERROR, "slice count unsupported\n");
480+ return AVERROR_PATCHWELCOME;
481+ }
482+
478483 f->quant_table_count = get_symbol(c, state, 0);
479484 if (f->quant_table_count > (unsigned)MAX_QUANT_TABLES || !f->quant_table_count) {
480485 av_log(f->avctx, AV_LOG_ERROR, "quant table count %d is invalid\n", f->quant_table_count);

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