[FFmpeg-devel,5/8] avcodec/cri: Stop the bitreader at the end of uncompressed input
Checks
Context |
Check |
Description |
andriy/x86_make |
success
|
Make finished
|
andriy/x86_make_fate |
success
|
Make fate finished
|
andriy/PPC64_make |
success
|
Make finished
|
andriy/PPC64_make_fate |
success
|
Make fate finished
|
Commit Message
Fixes: Timeout
Fixes: 29983/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CRI_fuzzer-6420415838814208
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
libavcodec/cri.c | 3 +++
1 file changed, 3 insertions(+)
Comments
On Mon, Feb 01, 2021 at 11:31:13PM +0100, Michael Niedermayer wrote:
> Fixes: Timeout
> Fixes: 29983/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CRI_fuzzer-6420415838814208
>
> Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
> libavcodec/cri.c | 3 +++
> 1 file changed, 3 insertions(+)
will apply
[...]
@@ -331,6 +331,9 @@ skip:
for (int y = 0; y < avctx->height; y++) {
uint16_t *dst = (uint16_t *)(p->data[0] + y * p->linesize[0]);
+ if (get_bits_left(&gbit) < avctx->width * bps)
+ break;
+
for (int x = 0; x < avctx->width; x++)
dst[x] = get_bits(&gbit, bps) << shift;
}