Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mp4read: moovin should not alter caller's g_atom
moov blocks contain MP4 file metadata. mp4read.c parses moov blocks using moovin, which recursively calls parse to process subblocks. In order to use the parse function, moovin modifies the value of g_atom, which is a global, static variable. When moovin returns, the position of the g_atom pointer has thus changed. For example it might be pointing to the last element of a trak[], meaning that g_atom++ pushes it out-of-bounds. the result is a buffer-over-read later at line 767. fix: moovin should not modify g_atom from the point of view of its caller. Save g_atom's value at the beginning of moovin calls and reset it before returning. fixes knik0#34.