]> gitweb.michael.orlitzky.com - libsvgtiny.git/commit
src/svgtiny.c: add assertions to unlikely error paths libcss
authorMichael Orlitzky <michael@orlitzky.com>
Thu, 24 Oct 2024 12:02:18 +0000 (08:02 -0400)
committerMichael Orlitzky <michael@orlitzky.com>
Thu, 24 Oct 2024 12:21:35 +0000 (08:21 -0400)
commitabde3ebcf0e25d3cfe9af530b5b4c4c6556aacb8
tree1718d112fa3665b7cb31b7ecafa8a777b4073708
parent6645b3e57f22801d8725fa5d5c3f003465b1e4e5
src/svgtiny.c: add assertions to unlikely error paths

While cleaning up our select_ctx at the end of svgtiny_parse(), we
loop through and get/remove/destroy any sheets it may have. If any of
these operations fails, we catch and propagate the error. However, we
only get/remove/destroy sheets that the libcss API has just told us
are valid. As a result, these error paths should never be taken. To
emphasize that, we add some assertions to the error paths in debug
builds. Production builds will still catch and propagate.
src/svgtiny.c