Yes, inherited stock receives special treatment when donated to charity.
When you inherit stock. you get what's called a stepped up basis to the fair market value on the date of the previous owner's death. This is true regardless of how long you hold it afterward.
For charitable donations of appreciated stock, you can generally deduct the full fair market value at the time of donation if you've held it long term. For stock held short term (less than a year), generally you're limited to deducting just your cost basis. However - as you mentioned, inherited stock is always considered long term, regardless of how long you personally held it.
Even though you only held the stock from July to December, you can still deduct full market value as of the donation date on your 2024.