Commit f2c099a
committed
Reset generic animation type to BM_TYPE_NONE if APNG processing fails.
Prior to APNG support, a regular non-animated PNG could be used as a still-frame command briefing animation. This started causing a crash when APNG support was added because any PNGs sent through generic_anim_stream() would get ga->type set to BM_TYPE_PNG, then sent through the APNG code... which would determine that they weren't APNGs, throw an ApngException, and generic_anim_stream() would return -1... except that BM_TYPE_PNG would still be set, so that when it later came time to render the still frame in generic_frame_render(), it would be sent through generic_anim_render_variable_frame_delay()... which expected a fully-formed APNG, tried to dereference ga->png.anim, and crashed.
This commit is a simple fix to reset ga->type to BM_TYPE_NONE if APNG processing fails, allowing the still-frame PNG to go through generic_anim_render_fixed_frame_delay(), the code path it used to take, and allowing it to display properly instead of crashing.1 parent e6c6cc3 commit f2c099a
1 file changed
+1
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
226 | 226 | | |
227 | 227 | | |
228 | 228 | | |
| 229 | + | |
229 | 230 | | |
230 | 231 | | |
231 | 232 | | |
| |||
0 commit comments