Fixed some memory issues

* invalid pointer, uninitialized buffer
dev-ui
Piotr Dziwinski 2013-05-27 20:59:50 +02:00
parent 950a3474d5
commit 12313fecf5
2 changed files with 4 additions and 1 deletions

View File

@ -17,6 +17,8 @@
#include "sound/oalsound/buffer.h"
#include <cstring>
Buffer::Buffer()
{
m_loaded = false;
@ -41,6 +43,7 @@ bool Buffer::LoadFromFile(std::string filename, Sound sound)
GetLogger()->Debug("Loading audio file: %s\n", filename.c_str());
SF_INFO fileInfo;
memset(&fileInfo, 0, sizeof(SF_INFO));
SNDFILE *file = sf_open(filename.c_str(), SFM_READ, &fileInfo);
GetLogger()->Trace(" channels %d\n", fileInfo.channels);

View File

@ -904,7 +904,7 @@ void CStudio::SetInfoText(std::string text, bool bClickable)
if ( list == 0 ) return;
list->Flush(); // just text
list->SetName(0, text.c_str());
list->SetItemName(0, text.c_str());
if ( text[0] == 0 ) bClickable = false;
list->SetSelectCap(bClickable);