The bug
The screen overlay shown when wearing a pumpkin gets stretched to fit the window size. All pumpkins in-game are properly square, so I wouldn't expect them to somehow become rectangular when equipped, and this also looks extremely strange for certain window shapes.
How to fix
Render the pumpkin overlay as a square (not a rectangle) in the middle of the screen, scaled up as much as possible so that all of it fits but such that scaling it any further would cause some of it to not fit. For any area not covered, repeat the color of the pixel at the edge of the texture out to the edge of the window as to cover that area.
I've attached a mockup resource pack that fixes this specifically for the 854x480 default resolution:
[media]Linked issues
relates to 1
Attachments
Comments 2
Related to MC-222544 as well.
Can confirm, has always affected the game ever since pumpkins were introduced.