[Scummvm-tracker] [ScummVM :: Bugs] #11342: The Dig crashes (3DS / PSP)

ScummVM :: Bugs trac at scummvm.org
Wed Feb 5 07:34:50 UTC 2020


#11342: The Dig crashes (3DS / PSP)
---------------------------+-----------------------
  Reporter:  MarioKartFan  |      Owner:  (none)
      Type:  defect        |     Status:  new
  Priority:  normal        |  Component:  --Unset--
Resolution:                |   Keywords:
      Game:                |
---------------------------+-----------------------
Comment (by bgK):

 Ok, thank you. I've been able to reproduce the issue and to reduce it to a
 file read corruption bug:
 {{{
         char *buffer = (char *)malloc(10*1024);

         FILE *f = fopen("sdmc:/ScummVM/The Dig/DIG.LA1", "r");
         if (!f) {
                 printf("Unable to open test file");
                 return 1;
         }

         fseek(f, 23808663, SEEK_SET);
         fseek(f, 0, SEEK_CUR);
         fread(buffer, 1, 2096, f);
         fseek(f, 23810752, SEEK_SET);
         fread(buffer, 1, 4, f);

         buffer[4] = 0;
         printf("1: %s\n", buffer);

         fclose(f);

         f = fopen("sdmc:/ScummVM/The Dig/DIG.LA1", "r");
         if (!f) {
                 printf("Unable to open test file");
                 return 1;
         }

         fseek(f, 23810752, SEEK_SET);
         fread(buffer, 1, 4, f);

         buffer[4] = 0;
         printf("2: %s\n", buffer);

         fclose(f);

         free(buffer);

         return 0;
 }}}

 Which outputs:
 {{{
 1: ����
 2: AKOS
 }}}

 While it should output the same thing twice. It's likely a bug in newlib.
 I'll have to check and report it to them.
-- 
Ticket URL: <https://bugs.scummvm.org/ticket/11342#comment:3>
ScummVM :: Bugs <https://bugs.scummvm.org>
ScummVM


More information about the Scummvm-tracker mailing list