Skip to content

ANI validation improvements

Benjamin Gilbert requested to merge bgilbert/gdk-pixbuf:ani into master
  • Reject files with multiple anih chunks. An anih chunk causes us to initialize a bunch of state, which we only expect to do once per file. Fixes #202 (closed).
  • Reject files with multiple INAM or IART chunks. These would cause memory leaks otherwise.
  • Validate anih chunk size. Before reading a chunk, we verify that enough bytes are available to match the chunk size declared by the file. However, uniquely, the anih chunk loader doesn't verify that this size matches the number of bytes it actually intends to read. Thus, if the chunk size is too small and the file ends in the middle of the chunk, we populate some context fields with stack garbage. (But we'd still fail later on because the file doesn't contain any images.) Fix this.

Merge request reports