hlsdemux: Fix cleanup when decryption fails
authorSebastian Dröge <sebastian@centricular.com>
Wed, 12 Feb 2014 09:58:45 +0000 (10:58 +0100)
committerSebastian Dröge <sebastian@centricular.com>
Wed, 12 Feb 2014 09:58:45 +0000 (10:58 +0100)
First unmap buffers, then unref them. And also unref the
key fragment.

ext/hls/gsthlsdemux.c

index bc8a877baf3051e601fca61e14ae534239272256..7d92f7fd61f0ad0cec60bf6d529c95619f4ce2c2 100644 (file)
@@ -1377,14 +1377,15 @@ decrypt_error:
   g_set_error (err, GST_STREAM_ERROR, GST_STREAM_ERROR_DECRYPT,
       "Failed to decrypt fragment");
 
-  gst_buffer_unref (key_buffer);
-  gst_buffer_unref (encrypted_buffer);
-  gst_buffer_unref (decrypted_buffer);
-
   gst_buffer_unmap (decrypted_buffer, &decrypted_info);
   gst_buffer_unmap (encrypted_buffer, &encrypted_info);
   gst_buffer_unmap (key_buffer, &key_info);
 
+  gst_buffer_unref (key_buffer);
+  gst_buffer_unref (encrypted_buffer);
+  gst_buffer_unref (decrypted_buffer);
+
+  g_object_unref (key_fragment);
   g_object_unref (encrypted_fragment);
   return ret;
 }