src/driver/pictureviewer/pictureviewer.cpp Picviewer need double image bufferSize for avoid segfault

Origin commit data
------------------
Commit: e15f31fee4
Author: Jacek Jendrzej <overx300@gmail.com>
Date: 2017-02-11 (Sat, 11 Feb 2017)
This commit is contained in:
Jacek Jendrzej
2017-02-11 21:08:25 +01:00
parent 8618764735
commit f5f669a803

View File

@@ -856,7 +856,7 @@ bool CPictureViewer::checkfreemem(size_t bufsize)
{ {
struct sysinfo info; struct sysinfo info;
sysinfo( &info ); sysinfo( &info );
if(bufsize + 4096 > (size_t)info.freeram + (size_t)info.freeswap){ 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__); dprintf(DEBUG_NORMAL, "[CPictureViewer] [%s - %d] Error: Out of memory\n", __func__, __LINE__);
return false; return false;
} }