aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/hdmi.c
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2018-05-08 16:39:40 +0530
committerMaarten Lankhorst <maarten.lankhorst@linux.intel.com>2018-05-11 09:04:25 +0200
commitbfe2e2c9564dd8e7c0109a7b1cc1bf61fbbedf95 (patch)
tree3db685550af0eed9de8db038fe6964e8b0f99a43 /drivers/video/hdmi.c
parentdrm/edid: Don't send bogus aspect ratios in AVI infoframes (diff)
downloadlinux-dev-bfe2e2c9564dd8e7c0109a7b1cc1bf61fbbedf95.tar.xz
linux-dev-bfe2e2c9564dd8e7c0109a7b1cc1bf61fbbedf95.zip
video/hdmi: Reject illegal picture aspect ratios
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@intel.com> Cc: "Lin, Jia" <lin.a.jia@intel.com> Cc: Akashdeep Sharma <akashdeep.sharma@intel.com> Cc: Jim Bride <jim.bride@linux.intel.com> Cc: Jose Abreu <Jose.Abreu@synopsys.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Emil Velikov <emil.l.velikov@gmail.com> Cc: Thierry Reding <thierry.reding@gmail.com> Cc: Hans Verkuil <hans.verkuil@cisco.com> Cc: linux-media@vger.kernel.org Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Jose Abreu <joabreu@synopsys.com> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/1525777785-9740-6-git-send-email-ankit.k.nautiyal@intel.com
Diffstat (limited to 'drivers/video/hdmi.c')
-rw-r--r--drivers/video/hdmi.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/video/hdmi.c b/drivers/video/hdmi.c
index 111a0ab6280a..38716eb50408 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;