ff_gen_search: make step 64it to prevent hypothetical integer overflow

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

The limit value could become slightly wrong in the last iteration

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
ff_gen_search: fix infinite loop

Fixes Ticket2639

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