vaapidecode: Fix videocodec state memory leak
authorVineeth TM <vineeth.tm@samsung.com>
Wed, 17 Feb 2016 08:20:08 +0000 (17:20 +0900)
committerSebastian Dröge <sebastian@centricular.com>
Wed, 17 Feb 2016 08:45:29 +0000 (10:45 +0200)
When state is not NULL and either width/height of video info is 0, then state leaks

https://bugzilla.gnome.org/show_bug.cgi?id=762173

gst/vaapi/gstvaapidecode.c

index 7e216ae..2c236c3 100644 (file)
@@ -254,6 +254,8 @@ gst_vaapidecode_update_src_caps (GstVaapiDecode * decode)
   if (!state || state->info.width == 0 || state->info.height == 0) {
     if (features)
       gst_caps_features_free (features);
+    if (state)
+      gst_video_codec_state_unref (state);
     return FALSE;
   }