[vlc-devel] Errors in TS/PMT/PAT handling [1/1]
Andy Lindsay
andy_vl at ananam.com
Sat Jul 26 17:56:05 CEST 2003
Hi,
I've found a couple of errors in ts.c which are fixed in the attached
patch. One of the errors is in the MODULE_NAME_IS_ts_dvbpsi part of the
file, the other is in both parts of the file but I've only fixed it in
the MODULE_NAME_IS_ts_dvbpsi part.
As a matter of interest, is the MODULE_NAME_IS_ts part used at all - I
think I read somewhere that VLC must always be compiled with libdvbpsi?
1. In TS_DVBPSI_HandlePMT(), when an updated PMT is received, the new
streams from the PMT are added without either checking if the streams
are already present or removing the old streams. The result is that the
number of streams in the program increases every time a new version of
the PMT is received.
In TS_DecodePMT() this is done correctly.
The attached patch fixes this in TS_DVBPSI_HandlePMT().
2. When a PAT is being processed and the ES for a PMT is added, memory
is malloc'd for the es_ts_data_t by input_AddES(). In this structure is
a pointer, p_psi_section and memory is also malloc'd for this. However,
when the ES is removed by input_DelES() the es_ts_data_t memory is
free'd but the p_psi_section data is not free'd leading to a memory
leak.
The attached patch fixes this in TS_DVBPSI_HandlePAT() by just removing
the malloc of the p_psi_section since it isn't used at all in
MODULE_NAME_IS_ts_dvbpsi part of ts.c.
I have not fixed this in the MODULE_NAME_IS_ts part of ts.c - to do so
either requires moving es_ts_data_t to become available to input_DelES()
or moving p_psi_section into es_descriptor_t
--
Andy Lindsay
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ts.patch
Type: application/octet-stream
Size: 1448 bytes
Desc: ts.patch
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20030726/1121779a/attachment.obj>
More information about the vlc-devel
mailing list