mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-24 13:56:33 +02:00
avcodec/hq_hqa: Check available space before reading slice offsets
Fixes: Timeout (43sec -> 18sec) Fixes: 14556/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HQ_HQA_fuzzer-5673543024508928 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 407e7c34ca8a3047e4f1b14287053638b4add68d) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
8a15ae6460
commit
106baf6ccd
@ -248,6 +248,9 @@ static int hqa_decode_frame(HQContext *ctx, AVFrame *pic, size_t data_size)
|
|||||||
int width, height, quant;
|
int width, height, quant;
|
||||||
const uint8_t *src = ctx->gbc.buffer;
|
const uint8_t *src = ctx->gbc.buffer;
|
||||||
|
|
||||||
|
if (bytestream2_get_bytes_left(&ctx->gbc) < 8 + 4*(num_slices + 1))
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
|
|
||||||
width = bytestream2_get_be16(&ctx->gbc);
|
width = bytestream2_get_be16(&ctx->gbc);
|
||||||
height = bytestream2_get_be16(&ctx->gbc);
|
height = bytestream2_get_be16(&ctx->gbc);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user