Commit f2afe961 authored by Paul B Mahol's avatar Paul B Mahol

avformat/nutenc: use av_reallocp_array()

Fixes memleak on allocation error.
Signed-off-by: 's avatarPaul B Mahol <onemda@gmail.com>
parent 6a70fead
......@@ -864,7 +864,7 @@ static int nut_write_packet(AVFormatContext *s, AVPacket *pkt)
for (i=0; i<s->nb_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++)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment