Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[vdr] Re: Bug in EIT parser.. this is the fix!!



Deti Fliegl wrote:
...
> Please replace the definition line by
> 
>    int                SectionLength, LoopLength;
> 
> and vdr should work.

Yes!
Wonderful, Deti!
Many thanks!

Actually, the same bug occurs four times in  si_parser.c.
Here is the patch I applied to my vdr:

diff -ru /home/cko/VDR099pre2/libdtv/libsi/si_parser.c ./libdtv/libsi/si_parser.c
--- /home/cko/VDR099pre2/libdtv/libsi/si_parser.c       Sun Oct  7 15:41:56 2001
+++ ./libdtv/libsi/si_parser.c  Tue Jan 29 21:25:00 2002
@@ -40,7 +40,7 @@
    pat_t               *Pat;
    pat_prog_t          *PatProgram;
    u_char              *Ptr;
-   u_int                SectionLength;
+   int                  SectionLength;
    int                  TransportStreamID;
    int                  PatVersion;
    struct Program      *Program;
@@ -87,7 +87,7 @@
    pmt_t               *Pmt;
    pmt_info_t          *PmtInfo;
    u_char              *Ptr;
-   u_int                SectionLength, ProgramInfoLength,
+   int                  SectionLength, ProgramInfoLength,
                         StreamLength, LoopLength;
    int                  ProgramID;
    int                  PcrID;
@@ -150,7 +150,7 @@
    sdt_t               *Sdt;
    sdt_descr_t         *SdtDescriptor;
    u_char              *Ptr;
-   u_int                SectionLength, LoopLength;
+   int                  SectionLength, LoopLength;
    int                  TransportStreamID;
    int                  SdtVersion;
    int                  OriginalNetworkID;
@@ -229,7 +229,7 @@
    eit_t               *Eit;
    eit_event_t         *EitEvent;
    u_char              *Ptr;
-   u_int                SectionLength, LoopLength;
+   int                  SectionLength, LoopLength;
    int                  ServiceID;
    int                  EitVersion;
    int                  TransportStreamID;




Reiner Rosin wrote:
...
> but there remains the question, whose fault this is (I assume PRO7 & Co.)

While some of the things that went on with PRO7 & Co. in the past
were certainly extremely stupid, this time I would not put all the
blame on them.

All those loops in si_parser.c will only terminate if SectionLength
happens to count down to exactly zero. 

Yes, the mistake may be on the other end. Still it is not best to
react on that with a crash. Depending on the case, one should
either correct the condition silently (as done with the above
code) or issue an error message (and possibly abort after that)
to allow the mistake to be corrected easily.

Having said that, I find Rolf's code very nice in general and
extremely useful!


Carsten.



Home | Main Index | Thread Index