[PATCH v12 05/10] video/hdmi: Reject illegal picture aspect ratios
Nautiyal, Ankit K
ankit.k.nautiyal at intel.com
Fri Apr 27 12:14:51 UTC 2018
From: Ville Syrjälä <ville.syrjala at linux.intel.com>
AVI infoframe can only carry none, 4:3, or 16:9 picture aspect
ratios. Return an error if the user asked for something different.
Cc: Shashank Sharma <shashank.sharma at intel.com>
Cc: "Lin, Jia" <lin.a.jia at intel.com>
Cc: Akashdeep Sharma <akashdeep.sharma at intel.com>
Cc: Jim Bride <jim.bride at linux.intel.com>
Cc: Jose Abreu <Jose.Abreu at synopsys.com>
Cc: Daniel Vetter <daniel.vetter at ffwll.ch>
Cc: Emil Velikov <emil.l.velikov at gmail.com>
Cc: Thierry Reding <thierry.reding at gmail.com>
Cc: Hans Verkuil <hans.verkuil at cisco.com>
Cc: linux-media at vger.kernel.org
Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
Reviewed-by: Jose Abreu <joabreu at synopsys.com>
---
drivers/video/hdmi.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/video/hdmi.c b/drivers/video/hdmi.c
index 111a0ab..38716eb5 100644
--- a/drivers/video/hdmi.c
+++ b/drivers/video/hdmi.c
@@ -93,6 +93,9 @@ ssize_t hdmi_avi_infoframe_pack(struct hdmi_avi_infoframe *frame, void *buffer,
if (size < length)
return -ENOSPC;
+ if (frame->picture_aspect > HDMI_PICTURE_ASPECT_16_9)
+ return -EINVAL;
+
memset(buffer, 0, size);
ptr[0] = frame->type;
--
2.7.4
More information about the dri-devel
mailing list