mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-29 22:00:58 +02:00
avcodec/apac: reset buffer on error
Fixes: repeatly parsing the same data after each 1 byte packet Fixes: Timeout Fixes: 51943/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APAC_fuzzer-5779018251370496 Reviewed-by: Paul B Mahol <onemda@gmail.com> Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
96748ac54f
commit
6634b6ae5f
@ -191,6 +191,8 @@ static int apac_decode(AVCodecContext *avctx, AVFrame *frame,
|
|||||||
if (c->bit_length < 0 ||
|
if (c->bit_length < 0 ||
|
||||||
c->bit_length > 17) {
|
c->bit_length > 17) {
|
||||||
c->bit_length = avctx->bits_per_coded_sample;
|
c->bit_length = avctx->bits_per_coded_sample;
|
||||||
|
s->bitstream_index = 0;
|
||||||
|
s->bitstream_size = 0;
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user