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/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit a0296fc056)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
32f047ce5c
commit
79d027ae7c
1 changed files with 3 additions and 2 deletions
|
|
@ -611,8 +611,9 @@ static int decode_idat_chunk(AVCodecContext *avctx, PNGDecContext *s,
|
|||
}
|
||||
if (!(s->state & PNG_IDAT)) {
|
||||
/* init image info */
|
||||
avctx->width = s->width;
|
||||
avctx->height = s->height;
|
||||
ret = ff_set_dimensions(avctx, s->width, s->height);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
s->channels = ff_png_get_nb_channels(s->color_type);
|
||||
s->bits_per_pixel = s->bit_depth * s->channels;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue