avcodec/huffyuvenc: fail if stats_out is too small instead of silently truncating

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avcodec/huffyuvenc: fix end pointer for stats_out

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>