]> code.delx.au - pulseaudio/commitdiff
dbus: Add an assertion to get rid of a warning from Coverity.
authorTanu Kaskinen <tanu.kaskinen@digia.com>
Mon, 26 Mar 2012 11:52:27 +0000 (14:52 +0300)
committerTanu Kaskinen <tanuk@iki.fi>
Wed, 28 Mar 2012 14:33:29 +0000 (17:33 +0300)
Coverity thinks that sample can be NULL when it's
dereferenced after this line. Adding an assertion doesn't
hurt here (in my opinion), and that should get rid of the
warning.

src/modules/dbus/iface-core.c

index 58abcb9f5f48183b102de63f2e0bbf19fa6090dd..97a46a58da635943baca9f4137700ba06b6ff6db 100644 (file)
@@ -1401,7 +1401,7 @@ static void handle_upload_sample(DBusConnection *conn, DBusMessage *msg, void *u
         goto finish;
     }
 
-    sample = pa_idxset_get_by_index(c->core->scache, idx);
+    pa_assert_se(sample = pa_idxset_get_by_index(c->core->scache, idx));
 
     if (n_volume_entries > 0) {
         sample->volume.channels = n_channels;