diff options
author | Vittorio Giovara <vittorio.giovara@gmail.com> | 2016-06-26 20:08:55 -0400 |
---|---|---|
committer | Vittorio Giovara <vittorio.giovara@gmail.com> | 2016-06-29 15:25:42 -0400 |
commit | 9f732e4c996243c1e57c2bbbec6c8b94c37a7a22 (patch) | |
tree | 5628c0887c46fc26d7449ee1aebb2072aad656d6 | |
parent | d8f3b0fb584677d4882e3a2d7c28f8b15c7319f5 (diff) | |
download | ffmpeg-streaming-9f732e4c996243c1e57c2bbbec6c8b94c37a7a22.zip ffmpeg-streaming-9f732e4c996243c1e57c2bbbec6c8b94c37a7a22.tar.gz |
tiffenc: Check av_pix_fmt_desc_get() return value
-rw-r--r-- | libavcodec/tiffenc.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/tiffenc.c b/libavcodec/tiffenc.c index 7c23ee2..24312f0 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; |