From 56ccefe22a32056f52336d9a5af3d258c3898e75 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 23 Mar 2017 12:23:56 +0100 Subject: [PATCH 1/2] cables.xml: update WTC SN; thanks to Gorcon Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/608c0926856c7555eb16163d52cde054f49ece39 Author: vanhofen Date: 2017-03-23 (Thu, 23 Mar 2017) Origin message was: ------------------ - cables.xml: update WTC SN; thanks to Gorcon ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- data/cables.xml | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/data/cables.xml b/data/cables.xml index 4970d600c..e05516a44 100644 --- a/data/cables.xml +++ b/data/cables.xml @@ -442,10 +442,10 @@ - - + + @@ -456,15 +456,21 @@ + + - - - - - + + + + + + + + + @@ -473,6 +479,11 @@ + + + + + From 69fb6175d4e045dd6ac8c785d46be4f3030cb917 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Thu, 23 Mar 2017 12:43:27 +0100 Subject: [PATCH 2/2] fix needed mem check Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/833a65c9e46a7ca45a09076225399a74fc623ae5 Author: Jacek Jendrzej Date: 2017-03-23 (Thu, 23 Mar 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/driver/pictureviewer/pictureviewer.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/driver/pictureviewer/pictureviewer.cpp b/src/driver/pictureviewer/pictureviewer.cpp index 84f2fc7a6..8b22b68aa 100644 --- a/src/driver/pictureviewer/pictureviewer.cpp +++ b/src/driver/pictureviewer/pictureviewer.cpp @@ -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;