Mailing List archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: VDR 0.63-deti Update
Carsten Koch writes:
> "Ralph Metzler <" wrote:
> ...
> > You can also statically allocate 4096 bytes. This is the maximum
> > allowed for EIT sections (AFAIR including the section header, but I
> > need to check this).
>
> You may be right, but I would always at least check the length
> before trusting my life to it. ;-)
>
> After all, it's a 16 bit length and (at least theoretically)
> it can become up to 65535 bytes long.
>
> I have recently traced a similar problem and saw lengths up
> to 57000 bytes in the trace output. Maybe that was caused by
> the fact that two programs were accessing /dev/vbi simultaneously,
> but in any event I'd consider
> allocate fixed buffer < 65565 bytes
> read data length into 16-bit value
> read this amount into buffer
> highly unsave....
>
I looked up all section definitions I could find and they all have a
section length entry of only 12 Bits. So, 4096 is enough and I have
to admit that there is a little bug in DVB/libdvb/DVB.hh.
In GetSection() seclen should be anded with 0xfff.
The section header is included in the 4096 byte limit. For EIT
sections they specifically say that the section_length entry
has a maximum of 4093 so that the whole section has a max. of 4096.
Ralph
Home |
Main Index |
Thread Index