Guard against dereferncing a null cdtext pointer.

This commit is contained in:
R. Bernstein
2009-05-14 22:30:50 -04:00
parent 13245c6a55
commit d297cdaf08

View File

@@ -88,7 +88,8 @@ cdtext_destroy (cdtext_t *p_cdtext)
char *
cdtext_get (cdtext_field_t key, const cdtext_t *p_cdtext)
{
if ((key == CDTEXT_INVALID) || (!p_cdtext->field[key])) return NULL;
if ((key == CDTEXT_INVALID) || !p_cdtext
|| (!p_cdtext->field[key])) return NULL;
return strdup(p_cdtext->field[key]);
}