[Kst] [Bug 64977] crash - no user input, no new data, full on kst crash

George Staikos staikos at kde.org
Fri Sep 26 15:41:34 CEST 2003


------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
     
http://bugs.kde.org/show_bug.cgi?id=64977     




------- Additional Comments From staikos at kde.org  2003-09-26 15:41 -------
Subject: kdeextragear-2/kst/kst

CVS commit by staikos: 

Ah this could be the reason.  Does this patch help?

CCMAIL: 64977 at bugs.kde.org


  M +8 -7      getdata.c   1.10


--- kdeextragear-2/kst/kst/getdata.c  #1.9:1.10
@@ -268,5 +268,5 @@ struct FormatType *GetFormat(const char 
   sprintf(format_file,"%s/format", filedir);
   fp = fopen(format_file, "r");
-  if (fp ==NULL) {
+  if (fp == NULL) {
     *error_code = GD_E_OPEN_FORMAT;
     Formats.n--; /* no need to free.  The next realloc will just do nothing */
@@ -1327,5 +1327,5 @@ int GetData(char *filename_in, char *fie
   if (filename[strlen(filename)-1]=='/') filename[strlen(filename)-1]='\0';
   F = GetFormat(filename, error_code);
-  if (*error_code!=GD_E_OK) {
+  if (!F || *error_code != GD_E_OK) {
     return(0);
   }
@@ -1364,9 +1364,9 @@ int GetNFrames(char *filename_in, int *e
   if (filename[strlen(filename)-1]=='/') filename[strlen(filename)-1]='\0';
   F = GetFormat(filename, error_code);
-  if (*error_code!=GD_E_OK) {
+  if (*error_code != GD_E_OK) {
     return(0);
   }
 
-  if (F->n_raw==0) {
+  if (!F || F->n_raw==0) {
     *error_code = GD_E_FORMAT;
     return(0);
@@ -1382,6 +1382,7 @@ int GetNFrames(char *filename_in, int *e
          (F->rawEntries[0].size*F->rawEntries[0].samples_per_frame);
 
-  nf-=2;
-  if (nf<0) nf = 0;
+  nf -= 2;
+  if (nf < 0)
+    nf = 0;
   return(nf);
 }
@@ -1411,5 +1412,5 @@ int GetSamplesPerFrame(char *filename_in
   }
 
-  if (F->n_raw==0) {
+  if (!F || F->n_raw==0) {
     *error_code = GD_E_FORMAT;
     return(0);


More information about the Kst mailing list