From 05df39cf3f818b9dd28df450c00289cf8f276898 Mon Sep 17 00:00:00 2001
From: Paul B Mahol <onemda@gmail.com>
Date: Sun, 9 Sep 2018 11:38:33 +0200
Subject: [PATCH] avcodec/tiff: check ff_lzw_decode_open() for failure

---
 libavcodec/tiff.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c
index 1b332a754dc..cfe0c277147 100644
--- a/libavcodec/tiff.c
+++ b/libavcodec/tiff.c
@@ -1403,6 +1403,8 @@ static av_cold int tiff_init(AVCodecContext *avctx)
     s->subsampling[1] = 1;
     s->avctx  = avctx;
     ff_lzw_decode_open(&s->lzw);
+    if (!s->lzw)
+        return AVERROR(ENOMEM);
     ff_ccitt_unpack_init();
 
     return 0;
-- 
GitLab