Menu

#857 PAINT used in a VIEWport and without delimitation border induces segmentation violation when ending code

closed
gfxlib2
2018-05-27
2017-06-06
No

Segmentation violation when ending this code:

Screenres 700, 600, 32
View (100, 100)-(600, 500)
Color &H0000AA
'Line (0, 0)-(500, 400),, B
Paint (250, 200)

Sleep

The fault occurs when the PAINT instruction fills an unlimited area (without encounter a delimitation border of matched color) in a viewport.
If before using PAINT, one draws a matched color delimitation border at the limits of the viewport (line 'Line (0, 0)-(500, 400),, B' uncommented), the behavior becomes right.

Discussion

  • Jeff Marshall

    Jeff Marshall - 2018-05-26
    • labels: --> gfxlib paint
    • assigned_to: Jeff Marshall
    • Component: compiler --> gfxlib2
     
  • Jeff Marshall

    Jeff Marshall - 2018-05-26

    proposed fix at
    https://github.com/freebasic/fbc/pull/86

    The proposed patch will correct the segfault. Not saying that the PAINT algo is completely bug free, it should be tested more.

    Problem was: wrong calculation for row when updating fbgfx "dirty" array, caused memory corruption due to accessing memory beyond the array.

     
  • Jeff Marshall

    Jeff Marshall - 2018-05-26
    • labels: gfxlib paint --> paint, segfault
     
  • Jeff Marshall

    Jeff Marshall - 2018-05-27
    • status: open --> closed
     

Log in to post a comment.