[FFmpeg-devel] [PATCH] avutil/md5: fix unaligned loads

Ronald S. Bultje rsbultje at gmail.com
Wed Feb 24 17:15:38 CET 2016


Hi,

On Wed, Feb 24, 2016 at 10:47 AM, James Almer <jamrial at gmail.com> wrote:

> On 2/24/2016 12:13 PM, Ronald S. Bultje wrote:
> > Hi,
> >
> > On Tue, Feb 23, 2016 at 8:40 PM, James Almer <jamrial at gmail.com> wrote:
> >
> >> Tested on x86 and benched with no apparent speed loss
> >
> >
> > That's because x86 supports unaligned loads.
> >
> > How come you get unaligned loads? Shouldn't this prevent it?
> >
> > -    if (HAVE_BIGENDIAN || (!HAVE_FAST_UNALIGNED && ((intptr_t)src &
> 3))) {
> > +    if (!HAVE_FAST_UNALIGNED && ((intptr_t)src & 3)) {
> >         while (src < end) {
> >             memcpy(ctx->block, src, 64);
> >             body(ctx->ABCD, (uint32_t *) ctx->block, 1);
> >
> > Ronald
>
> That code is never compiled/executed on x86 because HAVE_FAST_UNALIGNED is
> 1
> there.


So then I don't understand what ubsan is complaining about? Maybe
HAVE_FAST_UNALIGNED should be disabled when running under ubsan?

Ronald


More information about the ffmpeg-devel mailing list