]> git.sesse.net Git - ffmpeg/commitdiff
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 f91d2e393179d4a025ba1fef28ed5c73955aff35..251a72cf317c269ff701a3b8cd942d1d7916f4be 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;