gstvaapiencoder: Fix crash when handling rate control mask

Having a ratecontrol_mask equal to zero is not a bug, but the driver
might not be supporting any kind of rate control mechanisms.
Eg: JPEG Encoding
This commit is contained in:
Sreerenj Balachandran 2015-02-04 11:16:37 +02:00
parent 0609fad69c
commit 3332c25ef6

View file

@ -854,7 +854,7 @@ gst_vaapi_encoder_set_rate_control (GstVaapiEncoder * encoder,
goto error_operation_failed;
rate_control_mask = get_rate_control_mask (encoder);
if (!(rate_control_mask & (1U << rate_control)))
if (rate_control_mask && !(rate_control_mask & (1U << rate_control)))
goto error_unsupported_rate_control;
encoder->rate_control = rate_control;