The input `md_eval` is invalidated when calling `BKE_scene_graph_update_for_newframe`. The fix uses `BKE_modifier_get_original` to pass the original modifier to `apply_grease_pencil_for_modifier_all_keyframes` then calls `BKE_modifier_get_evaluated` after `BKE_scene_graph_update_for_newframe` to ensure the `md_eval` pointer is valid. Pull Request: https://projects.blender.org/blender/blender/pulls/129732