From: Ville Syrjälä <ville.syrj...@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.sha...@intel.com>
Cc: "Lin, Jia" <lin.a....@intel.com>
Cc: Akashdeep Sharma <akashdeep.sha...@intel.com>
Cc: Jim Bride <jim.br...@linux.intel.com>
Cc: Jose Abreu <jose.ab...@synopsys.com>
Cc: Daniel Vetter <daniel.vet...@ffwll.ch>
Cc: Emil Velikov <emil.l.veli...@gmail.com>
Cc: Thierry Reding <thierry.red...@gmail.com>
Cc: Hans Verkuil <hans.verk...@cisco.com>
Cc: linux-me...@vger.kernel.org
Signed-off-by: Ville Syrjälä <ville.syrj...@linux.intel.com>
Reviewed-by: Jose Abreu <joab...@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

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reply via email to