mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2025-09-29 01:31:23 +02:00
video: vidconsole: Fix null dereference of ops->measure
At present vidconsole_measure() tests ops->select_font before calling ops->measure, which would result in a null dereference when the console driver provides no ops for measure. Fixes: b828ed7d7929 ("console: Allow measuring the bounding box of text") Signed-off-by: Bin Meng <bmeng@tinylab.org> Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
a5899cc69a
commit
01c76f1a64
@ -603,7 +603,7 @@ int vidconsole_measure(struct udevice *dev, const char *name, uint size,
|
||||
struct vidconsole_ops *ops = vidconsole_get_ops(dev);
|
||||
int ret;
|
||||
|
||||
if (ops->select_font) {
|
||||
if (ops->measure) {
|
||||
ret = ops->measure(dev, name, size, text, bbox);
|
||||
if (ret != -ENOSYS)
|
||||
return ret;
|
||||
|
Loading…
x
Reference in New Issue
Block a user