[Mesa-dev] [PATCH] vdpau/decode: Check max width and max height.

Christian König deathsimple at vodafone.de
Sun Sep 15 07:25:58 PDT 2013


Reviewed and committed. 

Thanks, 
Christian. 

----- Ursprüngliche Mail -----

Von: "Rico Schüller" <kgbricola at web.de> 
An: mesa-dev at lists.freedesktop.org 
CC: "Rico Schüller" <kgbricola at web.de> 
Gesendet: Samstag, 14. September 2013 20:27:07 
Betreff: [Mesa-dev] [PATCH] vdpau/decode: Check max width and max height. 

--- 
src/gallium/state_trackers/vdpau/decode.c | 20 ++++++++++++++++++++ 
1 file changed, 20 insertions(+) 

diff --git a/src/gallium/state_trackers/vdpau/decode.c b/src/gallium/state_trackers/vdpau/decode.c 
index 47ca229..b144b83 100644 
--- a/src/gallium/state_trackers/vdpau/decode.c 
+++ b/src/gallium/state_trackers/vdpau/decode.c 
@@ -51,6 +51,7 @@ vlVdpDecoderCreate(VdpDevice device, 
vlVdpDecoder *vldecoder; 
VdpStatus ret; 
bool supported; 
+ uint32_t maxwidth, maxheight; 

if (!decoder) 
return VDP_STATUS_INVALID_POINTER; 
@@ -84,6 +85,25 @@ vlVdpDecoderCreate(VdpDevice device, 
return VDP_STATUS_INVALID_DECODER_PROFILE; 
} 

+ maxwidth = screen->get_video_param 
+ ( 
+ screen, 
+ templat.profile, 
+ PIPE_VIDEO_ENTRYPOINT_BITSTREAM, 
+ PIPE_VIDEO_CAP_MAX_WIDTH 
+ ); 
+ maxheight = screen->get_video_param 
+ ( 
+ screen, 
+ templat.profile, 
+ PIPE_VIDEO_ENTRYPOINT_BITSTREAM, 
+ PIPE_VIDEO_CAP_MAX_HEIGHT 
+ ); 
+ if (width > maxwidth || height > maxheight) { 
+ pipe_mutex_unlock(dev->mutex); 
+ return VDP_STATUS_INVALID_SIZE; 
+ } 
+ 
vldecoder = CALLOC(1,sizeof(vlVdpDecoder)); 
if (!vldecoder) { 
pipe_mutex_unlock(dev->mutex); 
-- 
1.8.3.1 

_______________________________________________ 
mesa-dev mailing list 
mesa-dev at lists.freedesktop.org 
http://lists.freedesktop.org/mailman/listinfo/mesa-dev 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20130915/dd12a598/attachment.html>


More information about the mesa-dev mailing list