Browse Source

avconv: free packet in write_frame() when discarding due to frame number limit

Fixes a memleak when using the -frames option with audio.
tags/n0.11
Justin Ruggles 13 years ago
parent
commit
c9594fe0fb
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      avconv.c

+ 3
- 1
avconv.c View File

@@ -887,8 +887,10 @@ static void write_frame(AVFormatContext *s, AVPacket *pkt, OutputStream *ost)
* reordering, see do_video_out()
*/
if (!(avctx->codec_type == AVMEDIA_TYPE_VIDEO && avctx->codec)) {
if (ost->frame_number >= ost->max_frames)
if (ost->frame_number >= ost->max_frames) {
av_free_packet(pkt);
return;
}
ost->frame_number++;
}



Loading…
Cancel
Save