FFmpeg: fix memory leak with AVIOContext


When avformat_open_input is called with a user-provided AVIOContext, we
are responsible for freeing the AVIOContext instance.

Introducing a AVDemuxerContextDeleter that takes care of this, based on
the AVFMT_FLAG_CUSTOM_IO flag. The whole functionality is moved to a new
freeAVIOContext, which is also used in EncodingFormatContext.

Fixes: QTBUG-151185
Pick-to: 6.12
Change-Id: I4d64b04e8a281d3ee3e202e85f66dd69b82cd542
Reviewed-by: Nils Petter Skålerud <nils.petter.skalerud@qt.io>
commit23afbda750d81fa7ff0ed6dd7b620f9b697a14b1
parent3a8bd3f180c9c8a2c51fe2d4c2672581420de316
authorTim Blechmann <tim.blechmann@qt.io>
committerTim Blechmann <tim.blechmann@qt.io>
commit timeWed, 7 Oct 2026 13:34:04 +0000