[xiph-commits] r16947 - trunk/oggdsf/src/lib/plugin/AxPlayer
cristianadam at svn.xiph.org
cristianadam at svn.xiph.org
Wed Mar 3 14:04:44 PST 2010
Author: cristianadam
Date: 2010-03-03 14:04:44 -0800 (Wed, 03 Mar 2010)
New Revision: 16947
Modified:
trunk/oggdsf/src/lib/plugin/AxPlayer/VideoTagBehavior.cpp
Log:
Terminating null bugfix and more comprehensive uriparser error messages.
Modified: trunk/oggdsf/src/lib/plugin/AxPlayer/VideoTagBehavior.cpp
===================================================================
--- trunk/oggdsf/src/lib/plugin/AxPlayer/VideoTagBehavior.cpp 2010-03-03 16:12:40 UTC (rev 16946)
+++ trunk/oggdsf/src/lib/plugin/AxPlayer/VideoTagBehavior.cpp 2010-03-03 22:04:44 UTC (rev 16947)
@@ -603,9 +603,10 @@
UriParserStateW state;
state.uri = &relativeSrc;
- if (uriParseUriW(&state, src) != URI_SUCCESS)
+ int error = uriParseUriW(&state, src);
+ if (error != URI_SUCCESS)
{
- LOG(logERROR) << "Failed to parse src: \"" << src << "\"";
+ LOG(logERROR) << "Failed to parse src: \"" << src << "\". Error: " << error;
uriFreeUriMembersW(&relativeSrc);
return;
}
@@ -614,19 +615,21 @@
state.uri = &absoluteBase;
CString siteUrl = GetSiteURL();
- if (uriParseUriW(&state, siteUrl) != URI_SUCCESS)
+ error = uriParseUriW(&state, siteUrl);
+ if (error != URI_SUCCESS)
{
- LOG(logERROR) << "Failed to parse site url: \"" << siteUrl << "\"";
+ LOG(logERROR) << "Failed to parse site url: \"" << siteUrl << "\". Error: " << error;
uriFreeUriMembersW(&relativeSrc);
uriFreeUriMembersW(&absoluteBase);
return;
}
UriUriW absoluteDest;
- if (uriAddBaseUriW(&absoluteDest, &relativeSrc, &absoluteBase) != URI_SUCCESS)
+ error = uriAddBaseUriW(&absoluteDest, &relativeSrc, &absoluteBase);
+ if (error != URI_SUCCESS)
{
LOG(logERROR) << "Failed to create absolute uri from relative src: \"" << src << "\""
- << " and absolute base: \"" << siteUrl << "\"";
+ << " and absolute base: \"" << siteUrl << "\". Error: " << error;
uriFreeUriMembersW(&relativeSrc);
uriFreeUriMembersW(&absoluteBase);
uriFreeUriMembersW(&absoluteDest);
@@ -635,18 +638,27 @@
CString dest;
int charsRequired;
- if (uriToStringCharsRequiredW(&absoluteDest, &charsRequired) != URI_SUCCESS)
+ error = uriToStringCharsRequiredW(&absoluteDest, &charsRequired);
+ if (error != URI_SUCCESS)
{
- LOG(logERROR) << "uriToStringCharsRequiredW failed";
+ LOG(logERROR) << "uriToStringCharsRequiredW failed. Error: " << error;
+ uriFreeUriMembersW(&relativeSrc);
+ uriFreeUriMembersW(&absoluteBase);
+ uriFreeUriMembersW(&absoluteDest);
return;
}
+ ++charsRequired;
dest.GetBuffer(charsRequired);
int charsWritten;
- if (uriToStringW(dest.GetBuffer(), &absoluteDest, charsRequired, &charsWritten) != URI_SUCCESS)
+ error = uriToStringW(dest.GetBuffer(), &absoluteDest, charsRequired, &charsWritten);
+ if (error != URI_SUCCESS)
{
- LOG(logERROR) << "uriToStringW failed";
+ LOG(logERROR) << "uriToStringW failed. Error: " << error;
+ uriFreeUriMembersW(&relativeSrc);
+ uriFreeUriMembersW(&absoluteBase);
+ uriFreeUriMembersW(&absoluteDest);
return;
}
More information about the commits
mailing list