Playback of Blu-Ray ISO file with mythfrontend encounters SEEK_SET failure at the file position of 2GB preventing further playback

Description

The problem I am reporting does *not* affect playing Blu-Ray optical disks as done by mythfrontend main menu “Optical Disks” -> “Play Optical Disc”. Nor does it seem to effect large DVD ISO’s (i.e. larger than 2GB). The only time
I have seen this bug is when using the ISO file.

I recently created an ISO of Blu-Ray disk (dd if=/dev/sr0 of=MyDisc?.iso) and put the resulting ISO in the /var/lib/mythtv/videos/ directory. I was pleased to see that mythfrontend would happily play this ISO (after sorting out libaacs0 and KEYDB.cfg) but every time the playback got to 11m19s, playback abruptly halted and mythfrontend went back to the ‘Videos’ menu. At that time the mythfrontend process had logged several messages like this:

Please note the message above is the first of 10 or so in a burst. -2147483648 is suspicious because it is 0x8000000 in hexadecimal which smells like 32 bit integer overflow. The other seeks are in sequence and further into integer overflow.

A similar message occurs if you try to ‘jump’ past the 2GB point during playback. For example if you are at the 8 minute point in playback and attempt to skip forward using the right arrow key. The same message is issued, but to state the obvious, the seek position is different.

Investigation of this message revealed that the fault is in fact one of signed 32-bit integer overflow resulting in a bad seek address. I have tested a proposed fix and found it to work fine. No side effects observed. A patch is attached to this bug. I propose this patch as a fix for this bug.

This bug was observed in ‘fixes/0.29’. Looking at master, this bug is still present.