From f2afe96181a85e04294379583b77b1f07b9013d6 Mon Sep 17 00:00:00 2001 From: Paul B Mahol Date: Sat, 14 Sep 2013 14:27:15 +0000 Subject: [PATCH] avformat/nutenc: use av_reallocp_array() Fixes memleak on allocation error. Signed-off-by: Paul B Mahol --- libavformat/nutenc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/nutenc.c b/libavformat/nutenc.c index 365b4637e3..f24813b8ea 100644 --- a/libavformat/nutenc.c +++ b/libavformat/nutenc.c @@ -864,7 +864,7 @@ static int nut_write_packet(AVFormatContext *s, AVPacket *pkt) for (i=0; inb_streams; i++) { int j; StreamContext *nus = &nut->stream[i]; - nus->keyframe_pts = av_realloc(nus->keyframe_pts, 2*nut->sp_count*sizeof(*nus->keyframe_pts)); + av_reallocp_array(&nus->keyframe_pts, 2*nut->sp_count, sizeof(*nus->keyframe_pts)); if (!nus->keyframe_pts) return AVERROR(ENOMEM); for (j=nut->sp_count == 1 ? 0 : nut->sp_count; j<2*nut->sp_count; j++)