avformat/utils: Fix division by 0

Fixes: signal_sigsegv_14999ef_1188_cov_2888512890_SVA_CL1_E.264

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
