- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I have created a custom JPEG encoder/decoder using the sample encoder/decoder from the IPP sample and I found out there is an memory leak in the jpeg encoder "ipp-samples\\image-codecs\\uic\\src\\codec\\image\\jpeg\\enc\\src\\jpegenc.cpp".
Actually the are two memory leaks. One is in theCJPEGEncoder::Clean function:
CJPEGEncoder::Clean...m_jpeg_restart_interval = 0;m_jpeg_mode = JPEG_BASELINE;...#ifdef _OPENMPif(m_jpeg_restart_interval != 0 && JT_RSTI == m_threading_mode){for(i = 0; i < m_num_threads; i++){m_state_t.Destroy();m_BitStreamOutT.Detach();}delete[] m_state_t;delete[] m_BitStreamOutT;}#endif
m_jpeg_restart_interval is never different from 0 :)
The other one isCJPEGEncoder::Init (this one is a bit tricky). If one CJPEGEncoder is used to encode multiple files with identical size and color parameters each time whenCJPEGEncoder::WriteHeader() is called more and more memory is "leaked".CJPEGEncoder::WriteHeader calls Init which frees all previous allocated memory except when allocating the resources for the Restart Interval (RSTI) threading model.
CJPEGEncoder::Init...#ifdef _OPENMPif(m_jpeg_restart_interval != 0 && JT_RSTI == m_threading_mode){m_BitStreamOutT = new CBitStreamOutput[m_num_threads];buflen = m_numxMCU * m_mcuWidth*m_mcuHeight*m_rstiHeight*m_jpeg_ncomp;for(i =0; i < m_num_threads; i++){m_BitStreamOutT.Init(buflen);}...
I found a solution for myself but it will be good if the problem is fixed in the next releases :)
PS: the m_lastDC variable is also never deallocated :)
Best
Martin.
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
thanks for reporting this issue, but this problemhas been solvedsome time ago. And fixed version will be available in next IPP release ( i suggest in 7.0.5).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
That's good to know.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page