Previous 199869 Revisions Next

r29545 Friday 11th April, 2014 at 23:33:45 UTC by O. Galibert
corefile: Don't crash on 0-length files [O. Galibert]
[src/lib/util]corefile.c

trunk/src/lib/util/corefile.c
r29544r29545
410410   file->back_char_tail = 0;
411411
412412   /* handle real files */
413   if (file->data == NULL)
413   if (file->length && file->data == NULL)
414414   {
415415      /* if we're within the buffer, consume that first */
416416      if (file->offset >= file->bufferbase && file->offset < file->bufferbase + file->bufferbytes)
r29544r29545
657657   UINT32 read_length;
658658
659659   /* if we already have data, just return it */
660   if (file->data != NULL)
660   if (file->data != NULL || !file->length)
661661      return file->data;
662662
663663   /* allocate some memory */

Previous 199869 Revisions Next


© 1997-2024 The MAME Team