mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-09-18 10:51:07 +02:00
Merge branch 'master' into pu/mp
Origin commit data
------------------
Branch: ni/coolstream
Commit: 7dfd4184ae
Author: vanhofen <vanhofen@gmx.de>
Date: 2017-03-27 (Mon, 27 Mar 2017)
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -170,7 +170,8 @@ bool CPictureViewer::DecodeImage (const std::string & _name, bool showBusySign,
|
||||
m_NextPic_Buffer = NULL;
|
||||
}
|
||||
size_t bufsize = x * y * 3;
|
||||
if (!checkfreemem(bufsize)){
|
||||
size_t resizeBuf = (m_endx - m_startx) * (m_endy - m_starty)*3;
|
||||
if (!checkfreemem(bufsize + resizeBuf)){
|
||||
return false;
|
||||
}
|
||||
m_NextPic_Buffer = (unsigned char *) malloc (bufsize);
|
||||
@@ -856,8 +857,8 @@ bool CPictureViewer::checkfreemem(size_t bufsize)
|
||||
{
|
||||
struct sysinfo info;
|
||||
sysinfo( &info );
|
||||
if(bufsize*2 + 4096 > (size_t)info.freeram + (size_t)info.freeswap){
|
||||
dprintf(DEBUG_NORMAL, "[CPictureViewer] [%s - %d] Error: Out of memory\n", __func__, __LINE__);
|
||||
if(bufsize + 4096 > (size_t)info.freeram + (size_t)info.freeswap){
|
||||
dprintf(DEBUG_NORMAL, "[CPictureViewer] [%s - %d] Error: Out of memory: need %zu > free %zu\n", __func__, __LINE__,bufsize,(size_t)info.freeram + (size_t)info.freeswap);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
Reference in New Issue
Block a user