ff_merge_samplerates will be deallocate a or b in some case, so add a check before free the format.
Unified · Split
| @@ -419,8 +419,10 @@ static int can_merge_formats(AVFilterFormats *a_arg, · 418 unmodified lines | ||
| 419 | 419 | av_freep(&ret); |
| 420 | 420 | return 1; |
| 421 | 421 | } else { |
| 422 | − av_freep(&a->formats); | |
| 423 | − av_freep(&b->formats); | |
| 422 | + if (a) | |
| 423 | + av_freep(&a->formats); | |
| 424 | + if (b) | |
| 425 | + av_freep(&b->formats); | |
| 424 | 426 | av_freep(&a); |
| 425 | 427 | av_freep(&b); |
| 426 | 428 | return 0; |