mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-29 16:31:05 +02:00
pictureviewer: do only show picture if decoding succeed
based upon patch "fix screensaver" by max10 <max_10@gmx.de>
Origin commit data
------------------
Commit: ff1a7b8640
Author: vanhofen <vanhofen@gmx.de>
Date: 2015-03-19 (Thu, 19 Mar 2015)
Origin message was:
------------------
- pictureviewer: do only show picture if decoding succeed
based upon patch "fix screensaver" by max10 <max_10@gmx.de>
This commit is contained in:
@@ -166,6 +166,7 @@ bool CPictureViewer::DecodeImage (const std::string & _name, bool showBusySign,
|
|||||||
if (fh) {
|
if (fh) {
|
||||||
if (m_NextPic_Buffer != NULL) {
|
if (m_NextPic_Buffer != NULL) {
|
||||||
free (m_NextPic_Buffer);
|
free (m_NextPic_Buffer);
|
||||||
|
m_NextPic_Buffer = NULL;
|
||||||
}
|
}
|
||||||
m_NextPic_Buffer = (unsigned char *) malloc (x * y * 3);
|
m_NextPic_Buffer = (unsigned char *) malloc (x * y * 3);
|
||||||
if (m_NextPic_Buffer == NULL) {
|
if (m_NextPic_Buffer == NULL) {
|
||||||
@@ -225,6 +226,7 @@ bool CPictureViewer::DecodeImage (const std::string & _name, bool showBusySign,
|
|||||||
printf ("Unable to read file or format not recognized!\n");
|
printf ("Unable to read file or format not recognized!\n");
|
||||||
if (m_NextPic_Buffer != NULL) {
|
if (m_NextPic_Buffer != NULL) {
|
||||||
free (m_NextPic_Buffer);
|
free (m_NextPic_Buffer);
|
||||||
|
m_NextPic_Buffer = NULL;
|
||||||
}
|
}
|
||||||
m_NextPic_Buffer = (unsigned char *) malloc (3);
|
m_NextPic_Buffer = (unsigned char *) malloc (3);
|
||||||
if (m_NextPic_Buffer == NULL) {
|
if (m_NextPic_Buffer == NULL) {
|
||||||
@@ -264,7 +266,7 @@ bool CPictureViewer::ShowImage (const std::string & filename, bool unscaled)
|
|||||||
free (m_CurrentPic_Buffer);
|
free (m_CurrentPic_Buffer);
|
||||||
m_CurrentPic_Buffer = NULL;
|
m_CurrentPic_Buffer = NULL;
|
||||||
}
|
}
|
||||||
DecodeImage (filename, true, unscaled);
|
if (DecodeImage (filename, true, unscaled))
|
||||||
DisplayNextImage ();
|
DisplayNextImage ();
|
||||||
// dbout("Show Image }\n");
|
// dbout("Show Image }\n");
|
||||||
return true;
|
return true;
|
||||||
|
Reference in New Issue
Block a user