mirror of https://git.ffmpeg.org/ffmpeg.git
pngdec: check bits_per_pixel for palette mode.
This fixes a out of array read Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
c7dc19d68f
commit
a63c813797
|
@ -494,7 +494,8 @@ static int decode_frame(AVCodecContext *avctx,
|
|||
} else if (s->bit_depth == 16 &&
|
||||
s->color_type == PNG_COLOR_TYPE_RGB_ALPHA) {
|
||||
avctx->pix_fmt = PIX_FMT_RGBA64BE;
|
||||
} else if (s->color_type == PNG_COLOR_TYPE_PALETTE) {
|
||||
} else if ((s->bits_per_pixel == 1 || s->bits_per_pixel == 2 || s->bits_per_pixel == 4 || s->bits_per_pixel == 8) &&
|
||||
s->color_type == PNG_COLOR_TYPE_PALETTE) {
|
||||
avctx->pix_fmt = PIX_FMT_PAL8;
|
||||
} else if (s->bit_depth == 1) {
|
||||
avctx->pix_fmt = PIX_FMT_MONOBLACK;
|
||||
|
|
Loading…
Reference in New Issue