From 9f732e4c996243c1e57c2bbbec6c8b94c37a7a22 Mon Sep 17 00:00:00 2001 From: Vittorio Giovara Date: Sun, 26 Jun 2016 20:08:55 -0400 Subject: tiffenc: Check av_pix_fmt_desc_get() return value --- libavcodec/tiffenc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'libavcodec/tiffenc.c') diff --git a/libavcodec/tiffenc.c b/libavcodec/tiffenc.c index 7c23ee2db8..24312f0dc5 100644 --- a/libavcodec/tiffenc.c +++ b/libavcodec/tiffenc.c @@ -254,7 +254,9 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, case AV_PIX_FMT_RGB24: case AV_PIX_FMT_GRAY8: 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); if (pfd->flags & AV_PIX_FMT_FLAG_PAL) s->photometric_interpretation = TIFF_PHOTOMETRIC_PALETTE; -- cgit v1.2.3