[FFmpeg-devel] [PATCH] avcodec/cfhd: Check transform type

Paul B Mahol onemda at gmail.com
Fri Aug 28 02:31:38 EEST 2020


On 8/28/20, Michael Niedermayer <michael at niedermayer.cc> wrote:
> Fixes: out of array access
> Fixes:
> 24823/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CFHD_fuzzer-4855119863349248
>
> 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/cfhd.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>

It is not invalid, but unsupported.

> diff --git a/libavcodec/cfhd.c b/libavcodec/cfhd.c
> index 291d53e02e..be06b184de 100644
> --- a/libavcodec/cfhd.c
> +++ b/libavcodec/cfhd.c
> @@ -486,7 +486,7 @@ static int cfhd_decode(AVCodecContext *avctx, void
> *data, int *got_frame,
>              s->sample_type = data;
>              av_log(avctx, AV_LOG_DEBUG, "Sample type? %"PRIu16"\n", data);
>          } else if (tag == TransformType) {
> -            if (data > 2) {
> +            if (data != 0 && data != 2) {
>                  av_log(avctx, AV_LOG_ERROR, "Invalid transform type\n");
>                  ret = AVERROR(EINVAL);
>                  break;
> --
> 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".


More information about the ffmpeg-devel mailing list