mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-28 20:53:54 +02:00
avcodec/g2meet: Check if adjusted pixel was on the stack
This basically checks if a pixel that was coded with prediction
and residual could have been stored using a previous case.
This avoids basically a string of 0 symbols stored in less than
50 bytes to hit a O(n²) codepath.
Fixes: Timeout (too slow to wait -> immediately)
Fixes: 8668/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_G2M_fuzzer-4895946310680576
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 9c84c162e9
)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
5812f834d4
commit
214556b9d9
@ -853,6 +853,9 @@ static int epic_decode_tile(ePICContext *dc, uint8_t *out, int tile_height,
|
||||
uint32_t ref_pix = curr_row[x - 1];
|
||||
if (!x || !epic_decode_from_cache(dc, ref_pix, &pix)) {
|
||||
pix = epic_decode_pixel_pred(dc, x, y, curr_row, above_row);
|
||||
if (is_pixel_on_stack(dc, pix))
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
if (x) {
|
||||
int ret = epic_add_pixel_to_cache(&dc->hash,
|
||||
ref_pix,
|
||||
|
Loading…
Reference in New Issue
Block a user