we need to allocate more than sizeof(direct_buffer_info), we use B_PAGE_SIZE

this should fix bug #3001 hopefully


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28504 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Jérôme Duval 2008-11-04 20:17:02 +00:00
parent d2184e65c1
commit 94f41556bf

View File

@ -562,11 +562,14 @@ MesaSoftwareRenderer::DirectConnected(direct_buffer_info *info)
{ {
BAutolock lock(fInfoLocker); BAutolock lock(fInfoLocker);
if (info) { if (info) {
if (!fInfo) if (!fInfo) {
fInfo = new direct_buffer_info(); // TODO size of info != sizeof(direct_buffer_info)
memcpy(fInfo, info, sizeof(*info)); // see GLView.cpp in glview_direct_info::glview_direct_info()
fInfo = (direct_buffer_info *)calloc(1, B_PAGE_SIZE);
}
memcpy(fInfo, info, B_PAGE_SIZE);
} else if (fInfo) { } else if (fInfo) {
delete fInfo; free(fInfo);
fInfo = NULL; fInfo = NULL;
} }