Browse Source

avformat/nutenc: use av_reallocp_array()

Fixes memleak on allocation error.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
tags/n2.1
Paul B Mahol 12 years ago
parent
commit
f2afe96181
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      libavformat/nutenc.c

+ 1
- 1
libavformat/nutenc.c View File

@@ -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++)


Loading…
Cancel
Save