#7039 closed defect (fixed)
Indeo3 unaligned accesses
Reported by: | wjp | Owned by: | wjp |
---|---|---|---|
Priority: | normal | Component: | Video |
Version: | Keywords: | ||
Cc: | Game: | Beavis & Butthead Virtual Stupidity |
Description
The indeo3 codec reads from the unaligned pointer 'ref_frm_pos' without using the appropriate memory access macros (READ_UINT16, READ_UINT32).
This causes crashes at least for BBVS on MIPS. Reported and tracked down by joostp.
Ticket imported from: bugs/7039.
Attachments (1)
Change History (10)
comment:1 by , 9 years ago
by , 9 years ago
Attachment: | indeo3_force_align.patch added |
---|
comment:2 by , 9 years ago
Attached is a patch that enables alignment checking in Indeo3Decoder::decodeChunk() on x86/x86_64, so that the issue can be reproduced more easily.
After applying the patch, make sure to compile ScummVM with SCUMM_NEED_ALIGNMENT defined:
CXXFLAGS="-DSCUMM_NEED_ALIGNMENT" ./configure ...
comment:3 by , 9 years ago
I don't think that patch will work, since it won't force the compiler to generate unaligned read instructions.
I have an attempt at a fix at https://github.com/wjp/scummvm/commits/indeo3_align . Could you test if it works for you?
comment:4 by , 9 years ago
If I disable optimizations, and force common/endian.h to fall back to the block of single-byte reads, I can use this patch to test it on x86 it seems, and with my patch to indeo3 it then no longer crashes.
comment:6 by , 9 years ago
Sounds good. Did we convince ourselves that the writes really are no issue and are always aligned?
comment:7 by , 9 years ago
I didn't check extensively, but the pointers that were written to that I looked at seemed to be aligned (don't know if that was due to luck or 'design', though).
comment:8 by , 9 years ago
Owner: | set to |
---|---|
Resolution: | → fixed |
Status: | new → closed |
comment:9 by , 6 years ago
Component: | → Video |
---|---|
Game: | → Beavis & Butthead Virtual Stupidity |
NB: There are also derived pointers such as 'ref_lp' that need attention.