avcodec/tiff: check ff_lzw_decode_open() for failure
authorPaul B Mahol <onemda@gmail.com>
Sun, 9 Sep 2018 09:38:33 +0000 (11:38 +0200)
committerPaul B Mahol <onemda@gmail.com>
Sun, 9 Sep 2018 09:38:33 +0000 (11:38 +0200)
libavcodec/tiff.c

index 1b332a7..cfe0c27 100644 (file)
@@ -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;