Mercurial > libavcodec.hg
comparison opt.c @ 7271:8c58eeb20826 libavcodec
Fix the logic to access the location of a string to free when setting
a new value for a string with av_set_string2(). Fix a segmentation
fault.
author | stefano |
---|---|
date | Sun, 13 Jul 2008 21:28:17 +0000 |
parents | d5a52b28c9de |
children | f0bf2db65dc3 |
comparison
equal
deleted
inserted
replaced
7270:26818b216bfb | 7271:8c58eeb20826 |
---|---|
194 } | 194 } |
195 return NULL; | 195 return NULL; |
196 } | 196 } |
197 | 197 |
198 if(alloc){ | 198 if(alloc){ |
199 av_free((void*)(((uint8_t*)obj) + o->offset)); | 199 av_free(*(void**)(((uint8_t*)obj) + o->offset)); |
200 val= av_strdup(val); | 200 val= av_strdup(val); |
201 } | 201 } |
202 | 202 |
203 memcpy(((uint8_t*)obj) + o->offset, &val, sizeof(val)); | 203 memcpy(((uint8_t*)obj) + o->offset, &val, sizeof(val)); |
204 return o; | 204 return o; |