[FFmpeg-devel] [PATCH 1/2] avcodec/arbc: Assume that at least one segment has a tile

Paul B Mahol onemda at gmail.com
Sun Sep 13 01:41:21 EEST 2020


On Sat, Sep 12, 2020 at 08:18:54PM +0200, Michael Niedermayer wrote:
> If no segment has a tile, the segment count really should be 0
> Fixes: Timeout (61sec -> 2sec)
> Fixes: 25445/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ARBC_fuzzer-5657711222718464
> 
> Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> ---
>  libavcodec/arbc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavcodec/arbc.c b/libavcodec/arbc.c
> index 06970f140b..9d8284df2b 100644
> --- a/libavcodec/arbc.c
> +++ b/libavcodec/arbc.c
> @@ -133,7 +133,7 @@ static int decode_frame(AVCodecContext *avctx, void *data,
>      if (nb_segments == 0)
>          return avpkt->size;
>  
> -    if (7 * nb_segments > bytestream2_get_bytes_left(&s->gb))
> +    if (7 * nb_segments + 6 > bytestream2_get_bytes_left(&s->gb))
>          return AVERROR_INVALIDDATA;
>  
>      if ((ret = ff_get_buffer(avctx, frame, AV_GET_BUFFER_FLAG_REF)) < 0)
> -- 
> 2.17.1
> 
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".

Again fix for timeouts that may break valid files.


More information about the ffmpeg-devel mailing list