What not to do
Many people especially athletes get injured. It's a part of life it just happens. The problem with being injured is you suddenly find yourself not being active anymore. The injury mentally takes over and so does the weight gain. It can be very depressing especially if you are someone who was training and all of a sudden you can't do anything but lay on the couch and scroll through Netflix or your phone. But that's where your first mistake is because if you let the injury keep you down you'll stay down and it won't be in a good place. The first thing we do is eat to soothe the pain and boredom of not being able to do much but it's not that you're really eating that much more, it's you not exercising at all and eating relatively the same amount of food. Weight gain while being injured doesn't have to happen and you don't need to be as active as you were before to prevent it from happening.
What you should do
While laying around the house the first thing that comes to your mind is snacking. That right there is the biggest mistake. Mindlessly snacking is a big culprit to weight gain while being injured. The best way to cut back on doing so is to simply stop buying the junk you snack on in the first place because when you buy it, it'll be laying around in your house and that's where u spend a lot of your day being injured. To keep your weight the same, put a hold on the foods you used to eat because you'll definitely have the room in your diet to cut out some empty calories. Best way to do that is to see where your extra calories are coming from. Find ways to keep yourself away from eating as much, write it down and keep it right on the fridge door.
Ways to stay positive
Yes, you're taken out of commission by an injury and it's too critical for you to go for a run. That's ok because there are many other ways to throw in enough exercise to avoid weight gain. It could be something as little as a short walk around the block, parking further away from the store or work to get a longer walk in, taking the long way out of the building. All of these steps add up to extra calories being burned and every calorie being burned counts if you want to lose weight while being injured and not be another victim to weight gain due to injury, it is unfair and depressing but you can stop it from happening by taking some of these steps.