# HG changeset patch # User Matti Hamalainen # Date 1210459250 -10800 # Node ID 8c2a166168ddc3d45b3375456a2798e42b39ff2e # Parent 04da24c63467803b361358ab33fc40298c4deb05 Fix a theoretical infinite loop: if plugin matches a mime-type, but probe function does not recognize contents, input probing gets into a infinite loop. diff -r 04da24c63467 -r 8c2a166168dd src/audacious/input.c --- a/src/audacious/input.c Sat May 10 22:47:49 2008 +0300 +++ b/src/audacious/input.c Sun May 11 01:40:50 2008 +0300 @@ -399,18 +399,18 @@ // apply mimetype check. note that stdio does not support mimetype check. mimetype = vfs_get_metadata(fd, "content-type"); - if ((ip = mime_get_plugin(mimetype)) != NULL && ip->enabled) { - while(1) { - if (!ip || !ip->enabled) - continue; - - pr = input_do_check_file(ip, fd, filename_proxy, loading); - - if(pr) { - g_free(filename_proxy); - vfs_fclose(fd); - return pr; - } + if (mimetype) { + ip = mime_get_plugin(mimetype); + g_free(mimetype); + } else + ip = NULL; + + if (ip && ip->enabled) { + pr = input_do_check_file(ip, fd, filename_proxy, loading); + if (pr) { + g_free(filename_proxy); + vfs_fclose(fd); + return pr; } }