Skip to content

va{h264,h265,av1}enc: fix potential crash on devices without rate control

Antonio Larrosa requested to merge antlarr/gstreamer:fix-gstva-crash into main

This fixes a crash in gst_va_h264_enc_class_init and gst_va_h265_enc_class_init when calling g_object_class_install_properties (object_class, n_props, properties);

When rate_control_type is 0, the following code is executed in :

  } else {
    n_props--;
    properties[PROP_RATE_CONTROL] = NULL;
  }

n_props has initially a value of N_PROPERTIES but PROP_RATE_CONTROL is not the last element in the array, so it's making g_object_class_install_properties fail to iterate over the properties array.

This applies the same fix to gstvah264enc.c and gstvah265enc.c .

Merge request reports