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: 7658db6423
Author: gixxpunk <thomas.harfmann@gmail.com>
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
This commit is contained in:
gixxpunk
2011-09-14 14:36:21 +00:00
parent 5101897c10
commit b3cb1514bf

View File

@@ -570,15 +570,20 @@ fb_pixel_t * CPictureViewer::getIcon (const std::string & name, int *width, int
} }
rgbbuff = (unsigned char *) malloc (x * y * 3); rgbbuff = (unsigned char *) malloc (x * y * 3);
if (rgbbuff == NULL) { if (rgbbuff == NULL) {
printf ("getIcon: Error: malloc\n"); printf ("getIcon: Error: rgbbuff malloc\n");
return NULL; return NULL;
} }
if (fh->get_pic (name.c_str (), &rgbbuff, &x, &y) == FH_ERROR_OK) { if (fh->get_pic (name.c_str (), &rgbbuff, &x, &y) == FH_ERROR_OK) {
int count = x*y; int count = x*y;
//fbbuff = (fb_pixel_t *) malloc(count * sizeof(fb_pixel_t)); //cs_malloc_uncached infrequently generates neutrino segfaults, so let's use malloc (striper)
fbbuff = (fb_pixel_t *) cs_malloc_uncached(count * sizeof(fb_pixel_t)); 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); //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++) { for(int i = 0; i < count ; i++) {
int transp = 0; int transp = 0;