[mythtv-commits] Ticket #12888: Memory Alignment Bug when calling swscale

MythTV noreply at mythtv.org
Wed Sep 28 08:28:55 UTC 2016


#12888: Memory Alignment Bug when calling swscale
-------------------------------------+--------------------------
 Reporter:  Robert Allan <rallan@…>  |          Owner:  pbennett
     Type:  Bug Report - Crash       |         Status:  assigned
 Priority:  minor                    |      Milestone:  unknown
Component:  Ports - rPi              |        Version:  0.28.0
 Severity:  medium                   |     Resolution:
 Keywords:                           |  Ticket locked:  0
-------------------------------------+--------------------------

Comment (by Robert Allan <rallan@…>):

 Yes I had detected errors in other parts of MythTv but could not guarantee
 them so isolated it to Mythpreviewgen which generates a repeatable fault.

 I have subsequently further identified the fault to be on the 1st line of
 the image in swscale.c where RA_FIX puts in debug code. See below

 // copy strides, so they can safely be modified
     if (c->sliceDir == 1) {
         // slices go from top to bottom
         int srcStride2[4] = { srcStride[0], srcStride[1], srcStride[2],
                               srcStride[3] };
         int dstStride2[4] = { dstStride[0], dstStride[1], dstStride[2],
                               dstStride[3] };

         reset_ptr(src2, c->srcFormat);
         reset_ptr((void*)dst2, c->dstFormat);

         /* reset slice direction at end of frame */
         if (srcSliceY + srcSliceH == c->srcH)
             c->sliceDir = 0;
 #ifdef RA_FIX
 //            LOG(VB_GENERAL, LOG_DEBUG,"C4515");
            printf("C45152\n");
 #endif
         //--
         // FAILS ON NEXT LINE
         //--
 #ifndef RA_FIX
         ret = c->swscale(c, src2, srcStride2, srcSliceY, srcSliceH, dst2,
                           dstStride2);
 #else
         ret = 1;
 #endif

 #ifdef RA_FIX
 //            LOG(VB_GENERAL, LOG_DEBUG,"C4515");
            printf("C45153\n");
 #endif

 Commenting out the conflicting line enables the rest of the image to be
 created. Shame that the resultant picture is not a valid picture format
 (presumably missing header info)! Previews are also now generated for all
 recordings, but again unreadable.

--
Ticket URL: <https://code.mythtv.org/trac/ticket/12888#comment:3>
MythTV <http://www.mythtv.org>
MythTV Media Center


More information about the mythtv-commits mailing list