[Top][All Lists]

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

Re: [Gnash-dev] Alignment in AMF data

From: strk
Subject: Re: [Gnash-dev] Alignment in AMF data
Date: Fri, 24 Oct 2008 10:32:03 +0200

On Thu, Oct 23, 2008 at 10:35:14PM -0700, Justin Dick wrote:
> Hi -
> I'm getting bus errors on my system in amf_read_value(). 

You mean amf0_read_value, in libcore/as_value.cpp, right ?

> Specifically, the
> buffer appears to contain a NUMBER_AMF0 type, which is then reinterpreted as
> a double. 

I guess you're talking about this:

        double dub = *(reinterpret_cast<double*>(b)); b += 8;

> The problem is that the position in the buffer (well, the memory
> address of the double) is 0x101c2d33, which is not aligned to the size of a
> double.  This fails on my MIPS machine, which has strict alignment rules.

Right. I understand. The code above is bogus indeed.

> Is it legal to pack data like this in an AMF stream?  Or do I have some
> other data corruption issue higher up the call stack?

It is legal for AMF stream to contain data so packed.
It is illegal for us to ignore alignment issues and just
pretend a pointer-to-char is a pointer-to-double.

Thanks for pointing this out, I filed a bug 
report on savannah:


reply via email to

[Prev in Thread] Current Thread [Next in Thread]