From f5f669a8033c3a61ee590aafbd71babc92bdcb62 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sat, 11 Feb 2017 21:08:25 +0100 Subject: [PATCH] src/driver/pictureviewer/pictureviewer.cpp Picviewer need double image bufferSize for avoid segfault Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/e15f31fee48dfc9bea91fd892621fdd36df5a0d7 Author: Jacek Jendrzej Date: 2017-02-11 (Sat, 11 Feb 2017) --- src/driver/pictureviewer/pictureviewer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/driver/pictureviewer/pictureviewer.cpp b/src/driver/pictureviewer/pictureviewer.cpp index 4bb9a63cf..84f2fc7a6 100644 --- a/src/driver/pictureviewer/pictureviewer.cpp +++ b/src/driver/pictureviewer/pictureviewer.cpp @@ -856,7 +856,7 @@ bool CPictureViewer::checkfreemem(size_t bufsize) { struct 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__); return false; }