| 662 | } |
| 663 | |
| 664 | static int parse_expr(AVExpr **e, Parser *p) |
| 665 | { |
| 666 | int ret; |
| 667 | AVExpr *e0, *e1, *e2; |
| 668 | if (p->stack_index <= 0) //protect against stack overflows |
| 669 | return AVERROR(EINVAL); |
| 670 | p->stack_index--; |
| 671 | |
| 672 | if ((ret = parse_subexpr(&e0, p)) < 0) |
| 673 | return ret; |
| 674 | while (*p->s == ';') { |
| 675 | p->s++; |
| 676 | e1 = e0; |
| 677 | if ((ret = parse_subexpr(&e2, p)) < 0) { |
| 678 | av_expr_free(e1); |
| 679 | return ret; |
| 680 | } |
| 681 | e0 = make_eval_expr(e_last, 1, e1, e2); |
| 682 | if (!e0) { |
| 683 | av_expr_free(e1); |
| 684 | av_expr_free(e2); |
| 685 | return AVERROR(ENOMEM); |
| 686 | } |
| 687 | }; |
| 688 | |
| 689 | p->stack_index++; |
| 690 | *e = e0; |
| 691 | return 0; |
| 692 | } |
| 693 | |
| 694 | static int verify_expr(AVExpr *e) |
| 695 | { |
no test coverage detected