af_aresample: fix leak on alloc failure

Fixes CID733798
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2012-10-11 16:48:25 +02:00
parent 7457da3698
commit 9ba2484ece

View File

@ -49,8 +49,10 @@ static av_cold int init(AVFilterContext *ctx, const char *args)
aresample->next_pts = AV_NOPTS_VALUE;
aresample->swr = swr_alloc();
if (!aresample->swr)
return AVERROR(ENOMEM);
if (!aresample->swr) {
ret = AVERROR(ENOMEM);
goto end;
}
if (args) {
char *ptr=argd, *token;