Now that I’m experimenting with video for the blog, I’m learning how to use video editing software. Currently, I’m experimenting with Sony Vegas. I like it a lot, it seems intuitive and fairly powerful.
One of the more interesting features of Vegas is a tool called Media Manager which helps you index and track your media. That’s important because video files are huge—the original file for my drive home is 3.5 GB—and I won’t be able to store them all on my hard drive. (Although, terabyte USB drives are less than $200…) I’ll have to burn them off to DVD, and it would be nice to have a database of what’s stored where.
While I was experimenting with Medial Manager, I tried to load the .WAV file that contains the music playing in the background of my last video and Vegas crashed.
A little experimentation showed that it was only those music files that crashed Vegas, not any of the the other sound files or any of the video files. Also, the problem went away when I disabled Media Manager.
Each time Vegas crashed, it popped up an error message box that said “This application has encountered a fatal exception and will close.” Not very helpful by itself, but there was a Details button, so I clicked it. With most Windows applications this would be some ugly bit of hex code and address offsets useful only to someone with access to the source code. But parts of Vegas—or at least Media Manager—are apparently written using the .NET framework because this was a normal .NET exception trace dump, and .NET has a much more helpful standard of error reporting.
Media Manager uses an embeddable desktop version of Microsoft SQL Server 2005 as its database, and it was clear from the library classes involved in the problem that Media Manager was calling the .NET framework SQL Client code to access the database, and it was blowing up because it was using a date value that was not a valid SQL Server date. The .WAV files I downloaded must have had a bad date in them somewhere, and Media Manager was blowing up when it tried to use it in a SQL query.
I poked at the .WAV files a bit, and I think I found the problem. The SQL Server datetime data type can hold a range of dates from January 1, 1753, through December 31, 9999. The .WAV files, however, were all timestamped with a creation date in the year 1601.
A lot of software bugs have this pattern, where a defect in one program—whatever was used to create the .WAV music files—generates data that exposes a defect in another program—crashing Sony Vegas.
In cases of invalid data like this, you normally don’t want the program to just crash. It should either fix the problem, report the problem to the user, or both. In this case, it’s an understandable mistake. If I were a developer or tester at Sony Creative Software, I doubt I would have given much thought to how the software should handle a file that purported to have been created 350 years before the invention of the computer.