avcodec/zmbv: remove useless zero check on dimensions
authorMichael Niedermayer <michael@niedermayer.cc>
Sun, 26 Aug 2018 22:46:54 +0000 (00:46 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Sun, 2 Sep 2018 22:01:32 +0000 (00:01 +0200)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/zmbv.c

index f91d2e3..251a72c 100644 (file)
@@ -599,12 +599,11 @@ static av_cold int decode_init(AVCodecContext *avctx)
     c->decomp_size = (avctx->width + 255) * 4 * (avctx->height + 64);
 
     /* Allocate decompression buffer */
-    if (c->decomp_size) {
-        if (!(c->decomp_buf = av_mallocz(c->decomp_size))) {
-            av_log(avctx, AV_LOG_ERROR,
-                   "Can't allocate decompression buffer.\n");
-            return AVERROR(ENOMEM);
-        }
+    c->decomp_buf = av_mallocz(c->decomp_size);
+    if (!c->decomp_buf) {
+        av_log(avctx, AV_LOG_ERROR,
+                "Can't allocate decompression buffer.\n");
+        return AVERROR(ENOMEM);
     }
 
     c->zstream.zalloc = Z_NULL;