avcodec/xan: Use av_realloc_array()
authorMichael Niedermayer <michaelni@gmx.at>
Mon, 19 Jan 2015 16:12:09 +0000 (17:12 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Mon, 19 Jan 2015 16:12:09 +0000 (17:12 +0100)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/xan.c

index 968464c..2c565ee 100644 (file)
@@ -567,8 +567,8 @@ static int xan_decode_frame(AVCodecContext *avctx,
                 return AVERROR_INVALIDDATA;
             if (s->palettes_count >= PALETTES_MAX)
                 return AVERROR_INVALIDDATA;
-            tmpptr = av_realloc(s->palettes,
-                                (s->palettes_count + 1) * AVPALETTE_SIZE);
+            tmpptr = av_realloc_array(s->palettes,
+                                      s->palettes_count + 1, AVPALETTE_SIZE);
             if (!tmpptr)
                 return AVERROR(ENOMEM);
             s->palettes = tmpptr;