avcodec/qtrleenc: use av_mallocz_array()
authorMichael Niedermayer <michaelni@gmx.at>
Fri, 18 Apr 2014 16:57:58 +0000 (18:57 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 18 Apr 2014 18:43:02 +0000 (20:43 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/qtrleenc.c

index 7f9525a..8750e30 100644 (file)
@@ -106,7 +106,7 @@ static av_cold int qtrle_encode_init(AVCodecContext *avctx)
 
     s->rlecode_table = av_mallocz(s->logical_width);
     s->skip_table    = av_mallocz(s->logical_width);
-    s->length_table  = av_mallocz((s->logical_width + 1)*sizeof(int));
+    s->length_table  = av_mallocz_array(s->logical_width + 1, sizeof(int));
     if (!s->skip_table || !s->length_table || !s->rlecode_table) {
         av_log(avctx, AV_LOG_ERROR, "Error allocating memory.\n");
         return AVERROR(ENOMEM);