Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

ARM: fix dereferencing misaligned pointers

Linear ring buffer generates problems on ARM when reading and writing short
pointers. This was leading to CI communication problems with VDR, resulting
with the following info in the log:
'not all devices ready after 30 seconds.'

Fixes #27. Thanks to JeroenT for report, help and testing.
  • Loading branch information...
commit 6bc3f5a419f97dcc1c9d062881a1d04738c5b391 1 parent 34dfb90
@manio authored
Showing with 5 additions and 4 deletions.
  1. +3 −2 Frame.cpp
  2. +2 −2 README
View
5 Frame.cpp
@@ -55,7 +55,8 @@ void Frame::Put(void)
{
if (rb && mem)
{
- *((short *) mem) = len;
+ *mem = len & 0xff;
+ *(mem+1) = len >> 8;
rb->Put(mem, len + LEN_OFF);
}
}
@@ -70,7 +71,7 @@ unsigned char *Frame::Get(int &l)
{
if (c > LEN_OFF)
{
- int s = *((short *) data);
+ int s = *data + (*(data+1) << 8);
if (c >= s + LEN_OFF)
{
l = glen = s;
View
4 README
@@ -115,8 +115,8 @@ plugin in case of problems.
To Narog for implementing the multiple adapter support
- To Peje, Unixer, Copper, HALLO01, udobroemme, ninjagp for their patience,
- support and testing on own hardware.
+ To Peje, Unixer, Copper, HALLO01, udobroemme, ninjagp, JeroenT for their
+ patience, support and testing on own hardware.
To the authors of VDR-SC plugin, FFdecsa and Oscam for their great work and
dedication
Please sign in to comment.
Something went wrong with that request. Please try again.