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:
parent
d2184e65c1
commit
94f41556bf
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user