[FFmpeg-devel] Massive memory leak in 6.1.1 (fixed on master)

Ville Syrjälä syrjala at sci.fi
Wed May 1 19:52:09 EEST 2024


Hi,

I ran into a massive memory leak while transcoding some audio
books after upgrading to ffmpeg 6.1.1 from 6.0.1.

Instead of the normal ~100 MiB rss it now exceeds 10 GiB in about
ten seconds and keeps on going up.

Command line used was approximately this:
ffmpeg -activation_bytes XXX -i book.aax -map 0:a -map 0:v -c:a mp3 -c:v copy \
-ss 0.000000 -to 909.038005 -metadata track="1/69" -metadata title="Chapter 1" book_01.mp3

Bisect points to:
commit 90fba2774304 ("avfilter/trim: switch to activate")

I then tried master and discovered that the leak is has been
fixed by these two commits:
commit 84e400ae37b1 ("avfilter/buffersrc: switch to activate")
commit d9e41ead8226 ("avfilter/avfilter: fix OOM case for default activate")

So those should be cherry-picked to the next 6.1 release (assuming
there will be one). Both cherry-pick cleanly, and afterwards the
leak is gone from the 6.1 branch as well.

-- 
Ville Syrjälä
syrjala at sci.fi


More information about the ffmpeg-devel mailing list