Commit 37608888 authored by Ralph Giles's avatar Ralph Giles

Fix NULL pointer dereference.

Patch by Tristan Matthews. https://review.xiph.org/184/


git-svn-id: http://svn.xiph.org/trunk/ao@19083 0101bb08-14d6-0310-b084-bc0e0c8e3800
parent f1a34ef1
......@@ -139,9 +139,9 @@ struct ao_functions {
void ao_read_config_files (ao_config *config);
#define adebug(format, args...) {\
if(device->verbose==2){ \
if(!device || device->verbose==2){ \
if(strcmp(format,"\n")){ \
if(device->funcs->driver_info()->short_name){ \
if(device && device->funcs->driver_info()->short_name){ \
fprintf(stderr,"ao_%s debug: " format,device->funcs->driver_info()->short_name,## args); \
}else{ \
fprintf(stderr,"debug: " format,## args); \
......@@ -153,9 +153,9 @@ void ao_read_config_files (ao_config *config);
}
#define averbose(format, args...) {\
if(device->verbose>0){ \
if(!device || device->verbose>0){ \
if(strcmp(format,"\n")){ \
if(device->funcs->driver_info()->short_name){ \
if(device && device->funcs->driver_info()->short_name){ \
fprintf(stderr,"ao_%s info: " format,device->funcs->driver_info()->short_name,## args); \
}else{ \
fprintf(stderr,"info: " format,## args); \
......@@ -167,9 +167,9 @@ void ao_read_config_files (ao_config *config);
}
#define ainfo(format, args...) {\
if(device->verbose>=0){ \
if(!device || device->verbose>=0){ \
if(strcmp(format,"\n")){ \
if(device->funcs->driver_info()->short_name){ \
if(device && device->funcs->driver_info()->short_name){ \
fprintf(stderr,"ao_%s info: " format,device->funcs->driver_info()->short_name,## args); \
}else{ \
fprintf(stderr,"info: " format,## args); \
......@@ -181,9 +181,9 @@ void ao_read_config_files (ao_config *config);
}
#define awarn(format, args...) {\
if(device->verbose>=0){ \
if(!device || device->verbose>=0){ \
if(strcmp(format,"\n")){ \
if(device->funcs->driver_info()->short_name){ \
if(device && device->funcs->driver_info()->short_name){ \
fprintf(stderr,"ao_%s WARNING: " format,device->funcs->driver_info()->short_name,## args); \
}else{ \
fprintf(stderr,"WARNING: " format,## args); \
......@@ -195,9 +195,9 @@ void ao_read_config_files (ao_config *config);
}
#define aerror(format, args...) { \
if(device->verbose>=0){ \
if(!device || device->verbose>=0){ \
if(strcmp(format,"\n")){ \
if(device->funcs->driver_info()->short_name){ \
if(device && device->funcs->driver_info()->short_name){ \
fprintf(stderr,"ao_%s ERROR: " format,device->funcs->driver_info()->short_name,## args); \
}else{ \
fprintf(stderr,"ERROR: " format,## args); \
......
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