mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-04 22:49:13 +02:00
vdpau/decode: Check max width and max height.
Reviewed-by: Christian König <christian.koenig@amd.com>
This commit is contained in:
parent
ffa3244534
commit
6f52295129
1 changed files with 20 additions and 0 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue