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

tiffenc: Check av_pix_fmt_desc_get() return value

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