Opened 13 years ago

Closed 12 years ago

#4938 closed defect (fixed)

second check of length is superflous

Reported by: Erik Hovland <erik@…> Owned by: Isaac Richards
Priority: trivial Milestone: unknown
Component: mythtv Version: head
Severity: low Keywords:
Cc: Ticket locked: no


In MHIContext::SetNetBootInfo?() the length given is checked and if it is not the right size the function returns. The call goes on to check length again. It is likely that the first check was added later. But since it is there the second check doesn't make any sense. So it should be removed.

Attachments (2)

libs_libmythtv_mhi.cpp-length-test-is-superflous.patch (1.0 KB) - added by Erik Hovland <erik@…> 13 years ago.
remove second length check
redundant_length_check.patch (1.4 KB) - added by David Matthews <dm@…> 12 years ago.
Remove redundant check

Download all attachments as: .zip

Change History (7)

Changed 13 years ago by Erik Hovland <erik@…>

remove second length check

comment:1 Changed 13 years ago by danielk

I've referred this to David Matthews, to me it looks like the first check was added as a temporary hack, and then forgotten about.

comment:2 Changed 13 years ago by danielk

Status: newinfoneeded_new

if someone could look up the spec, or otherwise verify which check is the correct one we can resolve this issue...

comment:3 Changed 12 years ago by dm@…

I've just looked back at this and found my comments on #2311 and changeset 11598. There's also an open ticket #5543 that is related.

It looks as though I should have removed the references to NBI_VERSION_ABSENT in my patch to #2311. The UK MHEG profile says that the network boot info descriptor should always have at least two bytes of data so the first test is there to avoid problems if an invalid descriptor is seen.

This is all related to ensuring that an "off air" MHEG message is correctly removed when a channel comes on air. It's also complicated, though, because we want to ensure that the MHEG engine does not reboot as a result of tuning to another channel under control of MHEG itself.

I've made these changes in my own version and also set up recordings when BBC3 and UK History come on air to see exactly what happens. I'll try and submit a patch with these changes if it seems to work out.


Changed 12 years ago by David Matthews <dm@…>

Remove redundant check

comment:4 Changed 12 years ago by David Matthews <dm@…>

I've tested this patch which is essentially the same as the original except that it also removes NBI_VERSION_ABSENT.


comment:5 Changed 12 years ago by danielk

Resolution: fixed
Status: infoneeded_newclosed

(In [19524]) Fixes #4938. Remove redundant code.

Note: See TracTickets for help on using tickets.