mirror of
https://github.com/xenia-project/FFmpeg.git
synced 2024-11-27 21:40:34 +00:00
avcodec/cngdec: Fix integer clipping
Fixes: runtime error: value -36211.7 is outside the range of representable values of type 'short' Fixes: 2992/clusterfuzz-testcase-6649611793989632 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
28f5753fed
commit
51090133b3
@ -153,7 +153,7 @@ static int cng_decode_frame(AVCodecContext *avctx, void *data,
|
||||
return ret;
|
||||
buf_out = (int16_t *)frame->data[0];
|
||||
for (i = 0; i < avctx->frame_size; i++)
|
||||
buf_out[i] = p->filter_out[i + p->order];
|
||||
buf_out[i] = av_clip_int16(p->filter_out[i + p->order]);
|
||||
memcpy(p->filter_out, p->filter_out + avctx->frame_size,
|
||||
p->order * sizeof(*p->filter_out));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user