Project

General

Profile

Bug #326

Buffer size too small for HVSC songlengths db

Added by Matti Tiainen about 11 years ago. Updated about 11 years ago.

Status:
Closed
Priority:
Trivial
Assignee:
-
Category:
plugins/sid
Target version:
Start date:
July 30, 2013
Due date:
% Done:

100%

Estimated time:
Affects version:

Description

When enabling HVSC songlength db support in the SID plugin code, I noticed that the current XS_BUF_SIZE is too small for some really long lines in the db, and the song lengths are not read correctly and/or the sids won't play (can't remember exactly).

The attached patch fixes the issue.

increase-xs-buf-size.patch (383 Bytes) increase-xs-buf-size.patch Matti Tiainen, July 30, 2013 14:20

History

#1 Updated by John Lindgren about 11 years ago

What type of line are we talking about here, a line of text? 1024 bytes seems like it should be more than long enough.

#2 Updated by Michael Schwendt about 11 years ago

$ wc -L Songlengths.txt
1312 Songlengths.txt

It's a INI-style database file with key=value pairs, and since some sidtune files contain lots of sub-songs (or sound effects), the "value" can get rather large.

#3 Updated by Matti Tiainen about 11 years ago

Ok, I tried to reproduce the issue again with the original XS_BUF_SIZE 1024, but could not actually trigger any other problems than this warning in audacious log:

Invalid MD5-hash in SongLengthDB file '/Volumes/Shared/C64Music/DOCUMENTS/Songlengths.txt' line #17712!
Invalid MD5-hash in SongLengthDB file '/Volumes/Shared/C64Music/DOCUMENTS/Songlengths.txt' line #17715!

Which is caused by the songlengths for these SIDS:

; /MUSICIANS/B/Bond_Alan/Randomly_generated_music_2_BASIC.sid
; /MUSICIANS/B/Bond_Alan/Randomly_generated_music_BASIC.sid

So probably my memory fails and I just wanted to fix the warnings tweaking SID plugin (I did some initial quick and dirty port of the SID plugin for sidplayfp before the "official" support arrived) or the issue got fixed some other way.

Sorry for the noise :P

#4 Updated by Michael Schwendt about 11 years ago

You may have misinterpreted my previous comment. A buffer size of 1024 is not enough, because the two longest lines in the file are 1312 characters plus end-of-line delimiters. The two entries you've mentioned are exactly those very long lines. For example:

; /MUSICIANS/B/Bond_Alan/Randomly_generated_music_2_BASIC.sid
24a19792bb845f93dac18ccd84d66476=0:31 0:50 1:02 0:45 0:57 0:50 0:45 0:46 1:09 1:04 1:04 0:43 0:43 0:46 0:31 1:15 0:50 0:54 1:09 1:04 1:09 1:02 0:58 1:04 0:39 0:57 0:46 0:46 0:43 0:52 0:36 1:04 0:43 0:45 0:59 1:04 0:43 0:58 0:59 0:46 0:52 0:58 0:58 0:52 0:39 0:50 0:50 0:58 0:46 0:41 0:39 0:45 1:02 0:58 1:02 0:52 0:46 0:57 0:54 0:52 0:39 1:04 0:46 0:50 0:39 1:04 0:52 0:52 0:43 0:50 0:58 0:50 0:45 0:57 0:46 1:04 0:58 0:45 1:09 1:02 0:54 0:39 0:31 1:09 0:43 0:52 1:15 0:50 0:52 0:43 1:04 1:09 0:59 0:43 0:45 1:04 0:31 0:45 1:09 0:58 0:57 0:41 0:57 0:46 0:39 1:04 0:57 1:09 0:57 1:09 0:45 0:43 0:43 0:50 0:50 0:57 1:09 1:04 1:02 1:02 0:50 0:59 0:58 0:45 0:45 0:46 1:04 1:09 0:41 0:57 0:43 1:15 1:09 0:45 0:45 0:31 0:52 0:57 0:50 0:46 0:58 0:46 0:45 0:50 0:41 0:43 1:04 1:02 0:36 0:41 0:57 0:52 1:04 0:43 0:43 0:52 0:58 0:52 0:58 1:15 0:39 0:35 0:43 0:54 0:46 0:50 0:52 0:52 0:46 0:43 0:58 0:57 1:09 0:35 0:43 1:08 1:07 0:58 0:57 0:58 0:54 0:31 0:35 0:45 0:50 0:45 0:58 0:54 1:04 0:45 0:43 0:54 0:39 0:58 0:50 0:58 0:57 0:52 0:39 1:07 0:52 0:52 0:52 1:04 0:45 0:58 0:59 0:57 0:58 1:04 0:35 0:43 0:35 0:46 0:50 1:09 0:57 1:04 0:52 0:45 0:43 1:15 0:39 0:39 0:45 0:52 0:57 0:41 0:52 0:57 0:45 0:43 1:02 0:43 0:50 0:50 0:57 1:04 0:35 0:50 0:35 0:46 0:50 0:57 0:41 0:39 0:39 0:58 0:41 1:09 0:57 1:02 1:07 0:39 1:09 0:46

#5 Updated by John Lindgren about 11 years ago

  • Status changed from New to Closed
  • Target version set to 3.4.1
  • % Done changed from 0 to 100
  • Affects version 3.4 added
  • Affects version deleted (3.4.1)

Also available in: Atom PDF