Hello,

In my program I initialize an AVFrame like this:

AVFrame *TestFrameRGB = NULL;
if (!TestFrameRGB)
   {
       TestFrameRGB=av_frame_alloc();
av_image_alloc(TestFrameRGB->data,TestFrameRGB->linesize,
pCodecCtx->width/scale,pCodecCtx->height/scale,
                    AV_PIX_FMT_RGB24,1);
   }


After using the AVFrame, I call these commands to free the allocated memory:

av_frame_unref(TestFrameRGB);
av_freep(&TestFrameRGB->data[0]);
av_frame_free(&TestFrameRGB);

The program works fine, but it consumes a lot of memory. A check with valgrind reports the memory allocated by av_image_alloc as definitely lost. I am using ffmpeg 4.2.4 on Ubuntu 20.04.
How can I free the allocated memory properly?

Thanks in advance,
Udo



_______________________________________________
Libav-user mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/libav-user

To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".

Reply via email to