10l (malloc check with the wrong pointer)

Simplification: I have to reconsider this trees and forest thing...

Also readded and documented the check i had in the beginning and removed
before applying. It avoids a possible div by zero.

Originally committed as revision 4934 to svn://svn.ffmpeg.org/ffmpeg/trunk
