[FFmpeg-devel] [libav-devel] [PATCH] dca: fix misaligned access in avpriv_dca_convert_bitstream
Andreas Cadhalpun
andreas.cadhalpun at googlemail.com
Thu Jan 14 00:22:13 CET 2016
On 13.01.2016 08:01, Luca Barbato wrote:
> On 13/01/16 00:56, Andreas Cadhalpun wrote:
>> src and dst are only 8-bit-aligned, so accessing them as uint16_t causes
>> SIGBUS crashes on architectures like sparc.
>>
>> This fixes ubsan runtime error: load of misaligned address for type
>> 'const uint16_t', which requires 2 byte alignment
>>
>> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>
>> ---
>> libavcodec/dca.c | 9 +++++----
>> 1 file changed, 5 insertions(+), 4 deletions(-)
>
> Why is not aligned?
These are uint8_t pointers (src, dst), so they are byte-aligned, but they
get cast into uint16_t pointers (ssrc, sdst), which need 2-byte-alignement.
Best regards,
Andreas
More information about the ffmpeg-devel
mailing list