From b3cb1514bfa534c2748ad8ac9506588991f34511 Mon Sep 17 00:00:00 2001 From: gixxpunk Date: Wed, 14 Sep 2011 14:36:21 +0000 Subject: [PATCH] cs_malloc_uncached() infrequently generates neutrino segfaults, so let's use malloc as a workaround - add a check if fbbuff is NULL git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-beta@1689 e54a6e83-5905-42d5-8d5c-058d10e6a962 Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/7658db642377df3cd217209cd2e62d5aa7077408 Author: gixxpunk Date: 2011-09-14 (Wed, 14 Sep 2011) Origin message was: ------------------ - cs_malloc_uncached() infrequently generates neutrino segfaults, so let's use malloc as a workaround - add a check if fbbuff is NULL git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-beta@1689 e54a6e83-5905-42d5-8d5c-058d10e6a962 --- src/driver/pictureviewer/pictureviewer.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/driver/pictureviewer/pictureviewer.cpp b/src/driver/pictureviewer/pictureviewer.cpp index 29750c6eb..36d7bdd8e 100644 --- a/src/driver/pictureviewer/pictureviewer.cpp +++ b/src/driver/pictureviewer/pictureviewer.cpp @@ -570,15 +570,20 @@ fb_pixel_t * CPictureViewer::getIcon (const std::string & name, int *width, int } rgbbuff = (unsigned char *) malloc (x * y * 3); if (rgbbuff == NULL) { - printf ("getIcon: Error: malloc\n"); + printf ("getIcon: Error: rgbbuff malloc\n"); return NULL; } if (fh->get_pic (name.c_str (), &rgbbuff, &x, &y) == FH_ERROR_OK) { int count = x*y; - //fbbuff = (fb_pixel_t *) malloc(count * sizeof(fb_pixel_t)); - fbbuff = (fb_pixel_t *) cs_malloc_uncached(count * sizeof(fb_pixel_t)); + //cs_malloc_uncached infrequently generates neutrino segfaults, so let's use malloc (striper) + fbbuff = (fb_pixel_t *) malloc(count * sizeof(fb_pixel_t)); + //fbbuff = (fb_pixel_t *) cs_malloc_uncached(count * sizeof(fb_pixel_t)); //printf("getIcon: decoded %s, %d x %d buf %x\n", name.c_str (), x, y, fbbuff); + if (fbbuff == NULL) { + printf ("getIcon: Error: fbbuff malloc\n"); + return NULL; + } for(int i = 0; i < count ; i++) { int transp = 0;