Skip to content

Commit

Permalink
Fix for Synaesthesia memory corruption
Browse files Browse the repository at this point in the history
We were allocating just half the required space and consequently
writing beyond the end of the array. This consistently caused
segfaults for me when using the Synaesthesia visualiser.

This fix appears to be consistent with the code used in other projects
which were also derived from the original Synaesthia project.

e.g. GStreamer/Source/gst-plugins-ugly/gst/synaesthesia/synaescope.c
  • Loading branch information
stuartm committed Jul 21, 2012
1 parent b14564a commit e331017
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mythplugins/mythmusic/mythmusic/polygon.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ class Bitmap
delete[] data;
width = w;
height = h;
data = new Pixel[w*h+extra];
data = new Pixel[2*w*h+extra];
clear();
}

void clear()
{
memset(data,0,sizeof(Pixel)*(width*height+extra));
memset(data,0,sizeof (Pixel)*(2*width*height+extra));
}
};
#endif

0 comments on commit e331017

Please sign in to comment.