[FFmpeg-trac] #5799(undetermined:new): Memory psudo-leak when FF_API_CODED_FRAME enabled
FFmpeg
trac at avcodec.org
Sun Sep 25 16:12:11 EEST 2016
#5799: Memory psudo-leak when FF_API_CODED_FRAME enabled
-------------------------------------+-------------------------------------
Reporter: DeHackEd | Owner:
Type: defect | Status: new
Priority: normal | Component:
Version: git-master | undetermined
Keywords: cc oom | Resolution:
Blocking: | Blocked By:
Analyzed by developer: 0 | Reproduced by developer: 0
-------------------------------------+-------------------------------------
Comment (by oromit):
This is caused by the following line:
https://github.com/FFmpeg/FFmpeg/blob/5a70e56f2/libavcodec/mpegvideo_enc.c#L1738
which ends up here:
https://github.com/FFmpeg/FFmpeg/blob/5a70e56f2/libavutil/frame.c#L331
Which in turn appends the new side data in this function:
https://github.com/FFmpeg/FFmpeg/blob/5a70e56f2/libavutil/frame.c#L617
So what is happening here is that inside of the coded_frame, all side data
is just endlessly appended, until av_frame_new_side_data eventually runs
out of memory to realloc all that side data.
A simple fix might be calling av_frame_unref(s->avctx->coded_frame) before
av_frame_copy_props in mpegvideo_enc.c.
--
Ticket URL: <https://trac.ffmpeg.org/ticket/5799#comment:6>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list