[mythtv-commits] Ticket #12228: mythtranscode lossless mpeg seg faults in v0.28-pre-2014-gcc58fb0
MythTV
noreply at mythtv.org
Tue Jul 29 20:42:05 UTC 2014
#12228: mythtranscode lossless mpeg seg faults in v0.28-pre-2014-gcc58fb0
------------------------------------+--------------------------------
Reporter: steve_g@… | Owner: jyavenard
Type: Bug Report - Crash | Status: infoneeded_new
Priority: minor | Milestone: 0.28
Component: MythTV - Mythtranscode | Version: Master Head
Severity: medium | Resolution:
Keywords: mythtranscode | Ticket locked: 0
------------------------------------+--------------------------------
Comment (by jyavenard):
Replying to [comment:4 steve_g@…]:
> "using av_copy_packet as you did will leak as the data contained in the
destination packet is never freed."
> The destination is "pkt", created with av_new_packet in the constructor,
and freed with av_free_packet in the destructor of the class MPEG2frame,
which is called from the destructor of MPEG2fixup. We might be losing the
source packet though.
>
> Im working on the backtrace.
This is not the issue.
In the current version, the content of the new packet (data) is copied
into the old packet data. There's no new memory allocation.
av_packet_copy replaces the old packet data member with the new one. The
old packet data now dangling. The code isn't equivalent.
You must free the old packet before calling copy. Which means that now for
every copy you need to free the packet, then copy (which will allocate a
new one and perform the copy.
This is inefficient and not the way to do things
--
Ticket URL: <https://code.mythtv.org/trac/ticket/12228#comment:5>
MythTV <http://www.mythtv.org>
MythTV Media Center
More information about the mythtv-commits
mailing list