[FFmpeg-devel] [PATCH] avcodec/jpeg2000: Check that codsty->log2_prec_widths/heights has been initialized

wm4 nfxjfg at googlemail.com
Tue Sep 5 11:39:56 EEST 2017


On Tue,  5 Sep 2017 00:04:08 +0200
Michael Niedermayer <michael at niedermayer.cc> wrote:

> Fixes: OOM
> Fixes: 2225/clusterfuzz-testcase-minimized-5505632079708160
> 
> 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/jpeg2000.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/libavcodec/jpeg2000.c b/libavcodec/jpeg2000.c
> index 94efc94c4d..9e1bbc2ec4 100644
> --- a/libavcodec/jpeg2000.c
> +++ b/libavcodec/jpeg2000.c
> @@ -506,6 +506,10 @@ int ff_jpeg2000_init_component(Jpeg2000Component *comp,
>          // update precincts size: 2^n value
>          reslevel->log2_prec_width  = codsty->log2_prec_widths[reslevelno];
>          reslevel->log2_prec_height = codsty->log2_prec_heights[reslevelno];
> +        if (!reslevel->log2_prec_width || !reslevel->log2_prec_height) {
> +            av_log(avctx, AV_LOG_ERROR, "COD/COC is missing\n");
> +            return AVERROR_INVALIDDATA;
> +        }
>  
>          /* Number of bands for each resolution level */
>          if (reslevelno == 0)

Just after we've _extensively_ discussed how such cryptic messages are
a bad idea, you're back with a new patch following exactly the same
pattern.


More information about the ffmpeg-devel mailing list