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
1 changed files with 7 additions and 4 deletions

View File

@ -562,11 +562,14 @@ MesaSoftwareRenderer::DirectConnected(direct_buffer_info *info)
{
BAutolock lock(fInfoLocker);
if (info) {
if (!fInfo)
fInfo = new direct_buffer_info();
memcpy(fInfo, info, sizeof(*info));
if (!fInfo) {
// TODO size of info != sizeof(direct_buffer_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) {
delete fInfo;
free(fInfo);
fInfo = NULL;
}