Hi, all,
I have written a program running on Mac, but meet a problem with
obviously big/little endian issue.
if I encode the data in an intel-cpu machine(little endian), then try to
decode it in an old machine(big endian), the code crash, and the
following message is received:
-------------
Exception: EXC_BAD_ACCESS (0x0001)
Codes: KERN_INVALID_ADDRESS (0x0001) at 0xc0000000
Thread 0 Crashed:
0 ...rcompany.yourcocoaframework 0x00171580
ClearBitBlock(unsigned*, unsigned, unsigned) + 92
1 ...rcompany.yourcocoaframework 0x00164d7c
CDecoder::RLDSigsAndSigns(unsigned, unsigned, unsigned*, unsigned*) + 172
2 ...rcompany.yourcocoaframework 0x001651a4
CDecoder::BitplaneDecode(unsigned) + 292
----------------
it shows the crash is in the ClearBitBlock() function.
but if I encode the data in the old machine(big endian), then decode it
in the intel-cpu machine(little endian), it just works fine.
btw, I just tested both encoding/decoding on the old machine(big
endian), it crashed at the same place. looks to me the decoding in big
endian machine has some problems.
I wonder if any of you could help me on this. Thanks a lot in advance.
Yours Sincerely,
-Allen
|