id,summary,reporter,owner,description,type,status,priority,milestone,component,version,severity,resolution,keywords,cc,mlocked 12888,Memory Alignment Bug when calling swscale,Robert Allan ,Peter Bennett,"There is a memory misalignment bug when calling swscale.cpp from mythavutil.cpp. This shows itself a ‘Bus Error’ when run on an Arm based Raspberry Pi3. Mythpreviewgen currently causes this failure and previews cannot be generated. Whilst memory misalignment appears to be a well known fault with swscale due to the packed format, I cannot work out what needs to be changed in the calling routine to wrap the buffers to get the correct alignment. The offending line is (as found by putting diagnostic output above and below): sws_scale(d->swsctx, src->data, src->linesize, 0, height, dst->data, dst->linesize); in function int MythAVCopy::Copy(AVPicture *dst, AVPixelFormat dst_pix_fmt, const AVPicture *src, AVPixelFormat pix_fmt, int width, int height) Web searching appears to indicate that the function avcodec_align_dimensions2 should be called but this requires a AVCodecContext object in the call and where to find this is not readily apparent to me. MythTV is version 0.28 with many of the subsequent fixes indicated by Trac implemented. My compiler is gcc v4.9.2, being the latest readily available on the Raspberry Pi. Any help would be much appreciated. ",Bug Report - Crash,closed,minor,unknown,Ports - rPi,0.28.0,medium,fixed,,,0