Commit 9f732e4c authored by Vittorio Giovara's avatar Vittorio Giovara

tiffenc: Check av_pix_fmt_desc_get() return value

parent d8f3b0fb
......@@ -255,6 +255,8 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
case AV_PIX_FMT_GRAY8:
case AV_PIX_FMT_PAL8:
pfd = av_pix_fmt_desc_get(avctx->pix_fmt);
if (!pfd)
return AVERROR_BUG;
s->bpp = av_get_bits_per_pixel(pfd);
if (pfd->flags & AV_PIX_FMT_FLAG_PAL)
s->photometric_interpretation = TIFF_PHOTOMETRIC_PALETTE;
......
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