[Ffmpeg-cvslog] r6325 - trunk/libavcodec/eval.c
Panagiotis Issaris
takis.issaris
Sun Sep 24 13:21:51 CEST 2006
Hi,
On zo, 2006-09-24 at 12:38 +0200, michael wrote:
> Author: michael
> Date: Sun Sep 24 12:38:14 2006
> New Revision: 6325
>
> Modified:
> trunk/libavcodec/eval.c
>
> Log:
> segfault fix
> thanks to takis for finding the cause of this
>
>
> Modified: trunk/libavcodec/eval.c
> ==============================================================================
> --- trunk/libavcodec/eval.c (original)
> +++ trunk/libavcodec/eval.c Sun Sep 24 12:38:14 2006
> @@ -87,6 +87,7 @@
> p->s= strchr(p->s, '(');
> if(p->s==NULL){
> av_log(NULL, AV_LOG_ERROR, "Parser: missing ( in \"%s\"\n", next);
> + p->s= next;
> return NAN;
> }
> p->s++; // "("
Darn it! That was fast! :)
Just for the heck of it, here was my solution for the same bug...
A one line vs a four line patch :) Painful...
@@ -68,7 +68,7 @@ static int strmatch(const char *s, const
static double evalPrimary(Parser *p){
double d, d2=NAN;
- char *next= p->s;
+ char *q, *next= p->s;
int i;
/* number */
@@ -86,13 +86,13 @@ static double evalPrimary(Parser *p){
}
}
- p->s= strchr(p->s, '(');
- if(p->s==NULL){
+ q= strchr(p->s, '(');
+ if(q==NULL){
av_log(NULL, AV_LOG_ERROR, "Parser: missing ( in \"%s\"\n",
next);
return NAN;
}
- p->s++; // "("
+ p->s = q+1; // "("
d= evalExpression(p);
if(p->s[0]== ','){
p->s++; // ","
With friendly regards,
Takis
More information about the ffmpeg-cvslog
mailing list