avcodec/xan: Use av_realloc_array()

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
pull/105/head
Michael Niedermayer 10 years ago
parent 6c702c3c63
commit 438c0a665a
  1. 4
      libavcodec/xan.c

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

Loading…
Cancel
Save