aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRico Schüller <[email protected]>2013-09-14 20:27:07 +0200
committerChristian König <[email protected]>2013-09-15 16:18:08 +0200
commit6f5229512906f8d545ed88dc2703f3c8ec45dc17 (patch)
tree3bb44d6853768f75e11934da0639d35601b2449a
parentffa3244534d4d1465b64e39332227f7a7322553c (diff)
vdpau/decode: Check max width and max height.
Reviewed-by: Christian König <[email protected]>
-rw-r--r--src/gallium/state_trackers/vdpau/decode.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/gallium/state_trackers/vdpau/decode.c b/src/gallium/state_trackers/vdpau/decode.c
index 47ca2294eff..b144b8368d7 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);