I guess in your movement code your player is marked as falling/sliding in that case?
You could do it the Borderlands way and check if the player doesn't change position significantly while in these states for a second or so. Then just allow them to jump and you should be able to get out of there.

In general you should try to keep the possibility from that to happen low.


POTATO-MAN saves the day! - Random