[mythtv-commits] [MythTV/mythtv] 969235: Free AVPacket with av_packet_free
noreply at github.com
Fri May 6 18:49:49 UTC 2022
Author: Klaas de Waal <klaas at kldo.nl>
Date: 2022-05-06 (Fri, 06 May 2022)
Free AVPacket with av_packet_free
Free AVPacket allocated with av_packet_alloc with av_packet_free
instead of with av_packet_unref followed by a delete statement.
Valgrind reports the "Mismatched ..." message here:
==1671692== Mismatched free() / delete / delete 
==1671692== at 0x48478DD: operator delete(void*, unsigned long) (vg_replace_malloc.c:935)
==1671692== by 0x4E34300: AvFormatDecoder::~AvFormatDecoder() (avformatdecoder.cpp:376)
==1684358== Mismatched free() / delete / delete 
==1684358== at 0x48478DD: operator delete(void*, unsigned long) (vg_replace_malloc.c:935)
==1684358== by 0x4E19A03: AvFormatDecoder::SeekReset(long long, unsigned int, bool, bool) (avformatdecoder.cpp:763)
This is caused by using a delete statement to free a packet
previously allocated by av_packet_alloc.
According to the comment in packet.h where av_packet_alloc is declared:
* Allocate an AVPacket and set its fields to default values. The resulting
* struct must be freed using av_packet_free().
This is now implemented.
More information about the mythtv-commits