diff --git a/libavcodec/sunrast.c b/libavcodec/sunrast.c index d9918f48b9..3fbec1dfbf 100644 --- a/libavcodec/sunrast.c +++ b/libavcodec/sunrast.c @@ -127,7 +127,7 @@ static int sunrast_decode_frame(AVCodecContext *avctx, void *data, buf += maplength; if (maplength && depth < 8) { - ptr = ptr2 = av_malloc((w + 15) * h); + ptr = ptr2 = av_malloc_array((w + 15), h); if (!ptr) return AVERROR(ENOMEM); stride = (w + 15 >> 3) * depth;