Commit a0296fc0 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/pngdec: Use ff_set_dimensions()

Fixes OOM
Fixes: 1314/clusterfuzz-testcase-minimized-4621997222920192

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpegSigned-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent cabfed68
...@@ -622,8 +622,9 @@ static int decode_idat_chunk(AVCodecContext *avctx, PNGDecContext *s, ...@@ -622,8 +622,9 @@ static int decode_idat_chunk(AVCodecContext *avctx, PNGDecContext *s,
} }
if (!(s->pic_state & PNG_IDAT)) { if (!(s->pic_state & PNG_IDAT)) {
/* init image info */ /* init image info */
avctx->width = s->width; ret = ff_set_dimensions(avctx, s->width, s->height);
avctx->height = s->height; if (ret < 0)
return ret;
s->channels = ff_png_get_nb_channels(s->color_type); s->channels = ff_png_get_nb_channels(s->color_type);
s->bits_per_pixel = s->bit_depth * s->channels; s->bits_per_pixel = s->bit_depth * s->channels;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment