I noticed while writing a file loader for Cineon files (anyone waiting
for this?) an annoying misfeature of the file magic detection. I was
testing for a long value in hex with the top bit set. Unfortunately,
the value to check is loaded into a (signed) int variable, and strtol()
fails because the value overflows, and so the magic number is not
detected. (In fact, the file contents are compared with 0x7FFFFFFF.)
I looked at the code, but didn't change anything because it also allows
comparisons on the magic number, so fiddling with the signedness might
not be a good idea.

The easy workaround is to search for a four-byte string value instead.

David Hodson  --  [EMAIL PROTECTED]  --  this night wounds time

Reply via email to