You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
avconv: free packet in write_frame() when discarding due to frame number limit
Fixes a memleak when using the -frames option with audio.
This commit is contained in:
4
avconv.c
4
avconv.c
@@ -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++;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user