decodeToFd memory leak

Hi

I found memory leak using decodeToFd blew.

while(1) {
          ret = ctx.jpegdec->decodeToFd(fd, ctx.in_buffer, ctx.in_file_size, pixfmt,
          width, height);
          g_renderer->render(fd);
          //      cout << "test " << endl;
        }

Please check the attached file and excute blew

./jpeg_decode  num_files 1 baboon.jpg out.raw --decode-fd
head /etc/nv_tegra_release
# R32 (release), REVISION: 2.1, GCID: 16294929, BOARD: t186ref, EABI: aarch64, DATE: Tue Aug 13 04:45:36 UTC 2019

06_jpeg_decode_testmemoryp.zip (619 KB)

Hi,
Thanks for reporting the issue. It is known and we have a quick solution in
https://elinux.org/L4T_Jetson/r32.2.1_patch
[MMAPI][DS4.0] Memory leak in MJPEG decoding

Please give it a try.

Hi DaneLLL

I tried r32.2.3. Memory leak still occured.

please check tegrastats log file and code attached.
tegrastats_log.zip (16.4 KB)
06_jpeg_decode_1.zip (619 KB)

Hi,
You still need the prebuilt lib on r32.2.3. Please replace it and give it a try.