avcodec/shorten: use av_reallocp_array()
authorMichael Niedermayer <michaelni@gmx.at>
Mon, 12 Jan 2015 22:27:18 +0000 (23:27 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Mon, 12 Jan 2015 22:46:50 +0000 (23:46 +0100)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/shorten.c

index 4c9cc0636c1b3a5c2dbd2fcf75bdb400b040c060..deae0fa1cebd30a9cb342de5dd517bf2e71b3b5a 100644 (file)
@@ -136,12 +136,12 @@ static int allocate_buffers(ShortenContext *s)
             return AVERROR_INVALIDDATA;
         }
 
-        if ((err = av_reallocp(&s->offset[chan],
-                               sizeof(int32_t) *
+        if ((err = av_reallocp_array(&s->offset[chan],
+                               sizeof(int32_t),
                                FFMAX(1, s->nmean))) < 0)
             return err;
 
-        if ((err = av_reallocp(&s->decoded_base[chan], (s->blocksize + s->nwrap) *
+        if ((err = av_reallocp_array(&s->decoded_base[chan], (s->blocksize + s->nwrap),
                                sizeof(s->decoded_base[0][0]))) < 0)
             return err;
         for (i = 0; i < s->nwrap; i++)
@@ -149,7 +149,7 @@ static int allocate_buffers(ShortenContext *s)
         s->decoded[chan] = s->decoded_base[chan] + s->nwrap;
     }
 
-    if ((err = av_reallocp(&s->coeffs, s->nwrap * sizeof(*s->coeffs))) < 0)
+    if ((err = av_reallocp_array(&s->coeffs, s->nwrap, sizeof(*s->coeffs))) < 0)
         return err;
 
     return 0;