[mythtv-commits] Ticket #12888: Memory Alignment Bug when calling swscale
MythTV
noreply at mythtv.org
Mon Sep 26 15:40:20 UTC 2016
#12888: Memory Alignment Bug when calling swscale
-----------------------------------------+---------------------
Reporter: Robert Allan <rallan@…> | Owner:
Type: Bug Report - Crash | Status: new
Priority: minor | Milestone: unknown
Component: MythTV - General | Version: 0.28.0
Severity: medium | Keywords:
Ticket locked: 0 |
-----------------------------------------+---------------------
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.
--
Ticket URL: <https://code.mythtv.org/trac/ticket/12888>
MythTV <http://www.mythtv.org>
MythTV Media Center
More information about the mythtv-commits
mailing list