Revision 0345f36b

View differences:

libavcodec/eval.c
185 185
    char *next= p->s;
186 186
    int i;
187 187

  
188
    if (!d)
189
        return NULL;
190

  
188 191
    /* number */
189 192
    d->value = av_strtod(p->s, &next);
190 193
    if(next != p->s){
......
288 291

  
289 292
static AVEvalExpr * new_eval_expr(int type, int value, AVEvalExpr *p0, AVEvalExpr *p1){
290 293
    AVEvalExpr * e = av_mallocz(sizeof(AVEvalExpr));
294
    if (!e)
295
        return NULL;
291 296
    e->type     =type   ;
292 297
    e->value    =value  ;
293 298
    e->param[0] =p0     ;
......
307 312
    while(p->s[0]=='^'){
308 313
        p->s++;
309 314
        e= new_eval_expr(e_pow, 1, e, parse_pow(p, &sign2));
315
        if (!e)
316
            return NULL;
310 317
        if (e->param[1]) e->param[1]->value *= (sign2|1);
311 318
    }
312 319
    if (e) e->value *= (sign|1);
......
318 325
    while(p->s[0]=='*' || p->s[0]=='/'){
319 326
        int c= *p->s++;
320 327
        e= new_eval_expr(c == '*' ? e_mul : e_div, 1, e, parse_factor(p));
328
        if (!e)
329
            return NULL;
321 330
    }
322 331
    return e;
323 332
}
......
326 335
    AVEvalExpr * e = parse_term(p);
327 336
    while(*p->s == '+' || *p->s == '-') {
328 337
        e= new_eval_expr(e_add, 1, e, parse_term(p));
338
        if (!e)
339
            return NULL;
329 340
    };
330 341

  
331 342
    return e;
......
343 354
    while(*p->s == ';') {
344 355
        p->s++;
345 356
        e= new_eval_expr(e_last, 1, e, parse_subexpr(p));
357
        if (!e)
358
            return NULL;
346 359
    };
347 360

  
348 361
    p->stack_index++;

Also available in: Unified diff