Mercurial > audlegacy
comparison src/audacious/input.c @ 4539:8c2a166168dd
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.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Sun, 11 May 2008 01:40:50 +0300 |
parents | 51b7809c2d87 |
children | cf6711eeb12f |
comparison
equal
deleted
inserted
replaced
4538:04da24c63467 | 4539:8c2a166168dd |
---|---|
397 } | 397 } |
398 | 398 |
399 | 399 |
400 // apply mimetype check. note that stdio does not support mimetype check. | 400 // apply mimetype check. note that stdio does not support mimetype check. |
401 mimetype = vfs_get_metadata(fd, "content-type"); | 401 mimetype = vfs_get_metadata(fd, "content-type"); |
402 if ((ip = mime_get_plugin(mimetype)) != NULL && ip->enabled) { | 402 if (mimetype) { |
403 while(1) { | 403 ip = mime_get_plugin(mimetype); |
404 if (!ip || !ip->enabled) | 404 g_free(mimetype); |
405 continue; | 405 } else |
406 | 406 ip = NULL; |
407 pr = input_do_check_file(ip, fd, filename_proxy, loading); | 407 |
408 | 408 if (ip && ip->enabled) { |
409 if(pr) { | 409 pr = input_do_check_file(ip, fd, filename_proxy, loading); |
410 g_free(filename_proxy); | 410 if (pr) { |
411 vfs_fclose(fd); | 411 g_free(filename_proxy); |
412 return pr; | 412 vfs_fclose(fd); |
413 } | 413 return pr; |
414 } | 414 } |
415 } | 415 } |
416 | 416 |
417 | 417 |
418 // apply ext_hash check | 418 // apply ext_hash check |