Skip to content

Commit 1a889fa

Browse files
authored
Merge pull request #289 from Libvisual/corona-fix-allocation-size
libvisual-plugins: Fix allocation size in "corona" to fix heap-buffer-overflow (fixes #263).
2 parents 50555f0 + b8f6a59 commit 1a889fa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libvisual-plugins/plugins/actor/corona/corona.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ bool Corona::setUpSurface(int width, int height) {
109109
m_real_image = (unsigned char *)calloc(1,width*height);
110110
if (m_real_image == 0) return false;
111111
m_image = m_real_image + m_width * (m_real_height - m_height);
112-
m_reflArray = (int*)malloc((m_real_height - m_height) + m_width);
112+
m_reflArray = (int*)malloc((m_real_height - m_height) * sizeof(*m_reflArray));
113113

114114
// Allocate the delta-field memory, and initialise it
115115
m_deltafield = (unsigned char**)malloc(m_width * m_height * sizeof(unsigned char*));

0 commit comments

Comments
 (0)