Fix warning: 'midQ' may be used uninitialized

Fix warning: 'midQ' may be used uninitialized in this function [-Wmaybe-uninitialized]