Signed-off-by: Mans Rullgard <mans@mansr.com> (cherry picked from commit e63dd5fb04ab831ca8f17fa824cfd703e317c1a1)