Changeset 549:c18dc165ab63 in roaraudio


Ignore:
Timestamp:
08/18/08 18:15:55 (16 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

dont segfaul on NULL

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libroar/stream.c

    r540 r549  
    295295int roar_str2codec(char * codec) { 
    296296 int i; 
    297  int guess = atoi(codec); 
    298  
    299  if ( guess > 0 ) 
     297 int guess; 
     298 
     299 if ( codec == NULL || *codec == 0 ) 
     300  return ROAR_CODEC_DEFAULT; 
     301 
     302 if ( (guess = atoi(codec)) > 0 ) 
    300303  return guess; 
    301304 
Note: See TracChangeset for help on using the changeset viewer.