I found out that if you give yourself a stack of 64 leather caps and dye, and dye them together in a crafting table, when you shift-click them out it fills up your inventory. I ended up with a stack of around 1600 Leather Caps.
This video I made explains the bug in a bit more detail:
http://www.youtube.com/watch?v=xqXTq7gSDqQ&feature=plcp
EDIT:
Something even weirder. The amount of Leather Armour produced seems to be going up in triangle numbers.
If you craft 1, you get 1 back.
If you craft 2, you get 3.
If you craft 3, you get 6.
With 4, you end up with 10.
As you can see, this is the sequence of triangle numbers. This is most definitely a bug.
Linked issues
Comments 6
You can't actually get a stack of 64 leather caps by legitimate methods - as such this isn't really a bug.
Although it may not necessarily be possible if playing Minecraft legit, it did cause problems for me as I was building my map in Creative (Mainly filling up my entire inventory space with leather armour.)
It is also something that shouldn't happen. When you craft 64 Dyed Helmets, you should get 64, not over 1000... I, myself, would still consider this to be a bug.
But even in creative, you can only get one leather helmet in a stack. If you're going to be using give commands, things will work how they're not supposed to. I will leave this open, but it really isn't a bug if it can't be triggered in vanilla means as the code would use assumptions which usually would never change 😉
What ends up happening is that it gives you 64 dyed armor pieces, but only takes 1 from the undyed crafting stack. If you shift click, it will repeat this until the stack of armor is gone and give you all of the partial stacks, or until your inventory is full. I agree that this is a bug, and can confirm.
The exact same thing also happens with every other piece of Leather Armour, and even in Survival Mode.