Opened 18 months ago
Last modified 17 months ago
#11426 new defect
Memory leak in Intel QSV decoder
| Reported by: | Aleksoid1978 | Owned by: | |
|---|---|---|---|
| Priority: | normal | Component: | avcodec |
| Version: | unspecified | Keywords: | QSV |
| Cc: | Blocked By: | ||
| Blocking: | Reproduced by developer: | no | |
| Analyzed by developer: | no |
Description (last modified by )
Summary of the bug:
Memory leak on call avcodec_flush_buffers() when use h264_qsv decoder in Windows 10/11.
For ease of reproduction, I simply took the official example https://github.com/FFmpeg/FFmpeg/blob/master/doc/examples/qsv_decode.c and added a call to avcodec_flush_buffers(decoder_ctx) in the read/decode loop for every 10th packet.
For each call to avcodec_flush_buffers(), memory consumption increases.
Windows 11 24H2.
Intel UHD 730 with the latest drivers, no memory leak.
Intel HD 530 with the latest drivers, memory leak.
I agree that the Intel drivers are to blame here, but maybe something is missing in the code in ffmpeg?
Attachments (1)
Change History (4)
comment:1 by , 18 months ago
| Description: | modified (diff) |
|---|
comment:2 by , 18 months ago
comment:3 by , 17 months ago
Memory leak on call avcodec_flush_buffers() when use h264_qsv decoder, also exists on Archlinux (up to date - 02 Mar 2025) with Intel UHD 730.
By applying this patch, no memory leak.



A possible solution, at least for me it works - instead of reinitializing the MFX decoder, just reset it.