[mythtv-commits] [MythTV/mythtv] 26079f: Free AVPacket with av_packet_free

kmdewaal noreply at github.com
Tue May 10 19:18:51 UTC 2022


  Branch: refs/heads/fixes/32
  Home:   https://github.com/MythTV/mythtv
  Commit: 26079f815a1723021dbe6a13eca0e66018f71e7b
      https://github.com/MythTV/mythtv/commit/26079f815a1723021dbe6a13eca0e66018f71e7b
  Author: Klaas de Waal <klaas at kldo.nl>
  Date:   2022-05-10 (Tue, 10 May 2022)

  Changed paths:
    M mythtv/libs/libmythtv/decoders/avformatdecoder.cpp

  Log Message:
  -----------
  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)
and here:
==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.

(cherry picked from commit 969235ed8abea04a3a39607bf6b699c743394bc5)




More information about the mythtv-commits mailing list