Commit 88982d11 authored by conrad's avatar conrad
Browse files

Annodex #1581: Apply patch from keelerda

oggz_comments_decode calls _oggz_comment_add_byname with "value" as NULL
under certain situations. This can then sometimes cause
_oggz_comment_add_byname to try to run strcmp on NULL, which fails.
parent 822b0af6
...@@ -366,7 +366,8 @@ _oggz_comment_add_byname (oggz_stream_t * stream, const char * name, const char ...@@ -366,7 +366,8 @@ _oggz_comment_add_byname (oggz_stream_t * stream, const char * name, const char
if (comment->name && !strcasecmp (name, comment->name)) { if (comment->name && !strcasecmp (name, comment->name)) {
if (comment->value == NULL) { if (comment->value == NULL) {
if (value == NULL) return comment; if (value == NULL) return comment;
} else if (!strcmp (value, comment->value)) { } else if ((value && !strcmp (value, comment->value)) ||
(value == NULL && comment->value == NULL)) {
return comment; return comment;
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment