Page 1 of 1

Bug with MIDI type

Posted: Tue Jun 18, 2013 6:37 pm
by cstadler18
Using latest release 1.9.6 (released Jun 03, 2013 : (with php 5.3.3) and Centos 6

http://www.midipedia.net/fichiers/midi/ ... is/Genesis Abacab.mid
Causes ID3 to just simply lock up and not return...
Help! Thanks, I also have a few examples from MP4 and MOV (Quicktime) that behave vary similarly let me know if you would like URLs for these also..

Thanks so much!
Craig

Re: Bug with MIDI type

Posted: Tue Jun 18, 2013 6:39 pm
by James Heinrich
I'll look at your sample file. Please also provide me samples of any other files that cause getID3 to hang.

Re: Bug with MIDI type

Posted: Tue Jun 18, 2013 6:56 pm
by James Heinrich
This file is truncated to 32kb (32768 bytes). The file header says there should be 22 tracks in the file but 32kB only gets about halfway through track #11, so only about half the file is there.

Nevertheless, getID3 should gracefully handle truncated files. This patch (around line 54 in module.audio.midi.php) should prevent it hanging and give a useful warning:

Code: Select all

while ((strlen($MIDIdata) - $offset) < 8) {
	if ($buffer = fread($this->getid3->fp, $this->getid3->fread_buffer_size())) {
		$MIDIdata .= $buffer;
	} else {
		$info['warning'][] = 'only processed '.($i - 1).' of '.$thisfile_midi_raw['tracks'].' tracks';
		$info['error'][] = 'Unabled to read more file data at '.ftell($this->getid3->fp).' (trying to seek to : '.$offset.'), was expecting at least 8 more bytes';
		return false;
	}
}
Full patched file attached, fix will be included in v1.9.7

Re: Bug with MIDI type

Posted: Tue Jun 18, 2013 10:30 pm
by cstadler18
http://walrus.wr.usgs.gov/tsunami/srila ... /pano1.mov also does the same. Thank you so much for your assistance and quick reply btw!!

Re: Bug with MIDI type

Posted: Wed Jun 19, 2013 12:37 am
by cstadler18
Other media/urls that cause hangup :

MOV->

http://media.messe.ch/Messe/360/zurich-halle1.mov
http://walrus.wr.usgs.gov/tsunami/srilanka05/images/pano1.mov
http://www.akabak.net/38th_street.mov
http://video1.hobbico.com/gallery/dtx/dtxd14-360-view2.mov

MP4->
http://www.agapornis.narod.ru/video/fisheri_baby_birds3.3gp
http://www.mobile-review.com/review/image/sonyeric/t700/photo/video2.mp4
http://www.crosscolors.com/test/IndianaJones.mp4

Thank you!!

Re: Bug with MIDI type

Posted: Wed Jun 19, 2013 1:05 am
by cstadler18

Re: Bug with MIDI type

Posted: Wed Jun 19, 2013 4:40 pm
by James Heinrich
Parses fine (0.041 seconds).
Parses fine (0.672 seconds). Does have an extraordinary number of entries (15123) under [asf][header_extension_object][extension_data_parsed][4][stream_names] so may take some time to render the page if you're displaying the analysis in a browser (e.g. demo.browse)
Parses fine (0.681 seconds). Does have an extraordinary number of entries (15123) under [asf][header_extension_object][extension_data_parsed][4][stream_names] so may take some time to render the page if you're displaying the analysis in a browser (e.g. demo.browse)

The last two files are both from Metacafe, I guess their encoder does weird (but legal) encoding things to put such a huge pile of (blank) stream names in the header.

But all 3 files do parse fine, and in under a second on my machine.

Re: Bug with MIDI type

Posted: Wed Jun 19, 2013 4:43 pm
by James Heinrich
cstadler18 wrote:http://walrus.wr.usgs.gov/tsunami/srila ... /pano1.mov also does the same.
Parses fine (0.049 seconds). Quicktime VR panorama.

Re: Bug with MIDI type

Posted: Wed Jun 19, 2013 4:48 pm
by James Heinrich
cstadler18 wrote:Other media/urls that cause hangup
I looked at all 7 URLs provided and none of them cause getID3 to hang.

Re: Bug with MIDI type

Posted: Sun Jun 30, 2013 4:18 am
by cstadler18
Thanks, recently we saw this one lock up... does it work for you?

http://previews.imineo.com/lucky-luke-phil-de-fer_.wmv

Re: Bug with MIDI type

Posted: Sun Jun 30, 2013 10:47 am
by James Heinrich
cstadler18 wrote:Thanks, recently we saw this one lock up... does it work for you?
Works fine: File parsed in 0.051 seconds.