libs: encoder: h264fei: remove unnecessary check
authorVíctor Manuel Jáquez Leal <vjaquez@igalia.com>
Tue, 17 Dec 2019 15:57:41 +0000 (16:57 +0100)
committerVíctor Manuel Jáquez Leal <vjaquez@igalia.com>
Tue, 17 Dec 2019 17:31:36 +0000 (18:31 +0100)
Issue detected by Coverity

There may be a null pointer dereference, or else the comparison
against null is unnecessary.

In gst_vaapi_encoder_h264_fei_encode: All paths that lead to this null
pointer comparison already dereference the pointer earlier

gst-libs/gst/vaapi/gstvaapiencoder_h264_fei.c

index e0fbe5054dfa55bafaa68225658ac499b8f8a22a..d643a6a67da40b6f879a5aef1fc3645421ca37ad 100644 (file)
@@ -2837,9 +2837,8 @@ gst_vaapi_encoder_h264_fei_encode (GstVaapiEncoder * base_encoder,
   /* ERRORS */
 error:
   {
-    if (reconstruct)
-      gst_vaapi_encoder_release_surface (GST_VAAPI_ENCODER (encoder),
-          reconstruct);
+    gst_vaapi_encoder_release_surface (GST_VAAPI_ENCODER (encoder),
+        reconstruct);
     if (picture2)
       gst_vaapi_enc_picture_unref (picture2);
     return status;