comparison opt.c @ 3735:6c407dc6ab4a libavcodec

Inform the user that a certain AVOption is out of range.
author takis
date Wed, 20 Sep 2006 08:28:24 +0000
parents 8b8773577dd9
children 67a63fa775a7
comparison
equal deleted inserted replaced
3734:6903463caf49 3735:6c407dc6ab4a
117 AVOption *o= find_opt(obj, name, NULL); 117 AVOption *o= find_opt(obj, name, NULL);
118 void *dst; 118 void *dst;
119 if(!o || o->offset<=0) 119 if(!o || o->offset<=0)
120 return NULL; 120 return NULL;
121 121
122 if(o->max*den < num*intnum || o->min*den > num*intnum) 122 if(o->max*den < num*intnum || o->min*den > num*intnum) {
123 return NULL; 123 av_log(NULL, AV_LOG_ERROR, "Value %lf for parameter '%s' out of range.\n", num, name);
124 return NULL;
125 }
124 126
125 dst= ((uint8_t*)obj) + o->offset; 127 dst= ((uint8_t*)obj) + o->offset;
126 128
127 switch(o->type){ 129 switch(o->type){
128 case FF_OPT_TYPE_FLAGS: 130 case FF_OPT_TYPE_FLAGS: