[FFmpeg-devel] [PATCH 2/3] avcodec/zmbv: remove useless zero check on dimensions
Michael Niedermayer
michael at niedermayer.cc
Mon Aug 27 02:50:36 EEST 2018
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
---
libavcodec/zmbv.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/libavcodec/zmbv.c b/libavcodec/zmbv.c
index f91d2e3931..251a72cf31 100644
--- a/libavcodec/zmbv.c
+++ b/libavcodec/zmbv.c
@@ -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;
--
2.18.0
More information about the ffmpeg-devel
mailing list