vdpau/decode: Check max width and max height.

Reviewed-by: Christian König <christian.koenig@amd.com>
This commit is contained in:
Rico Schüller 2013-09-14 20:27:07 +02:00 committed by Christian König
parent ffa3244534
commit 6f52295129

View file

@ -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);