From f495fbe76a2665cdea092999ca2dbb603d13280c Mon Sep 17 00:00:00 2001 From: Lukasz Marek Date: Fri, 28 Feb 2014 01:12:07 +0100 Subject: [PATCH] lavf/avio: fix ffurl_alloc error checks ffurl_alloc doc says it returns >= 0 in case of success. avio treats non-zero as errors. Signed-off-by: Lukasz Marek --- libavformat/avio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavformat/avio.c b/libavformat/avio.c index a76f9db3b8..e366dfa388 100644 --- a/libavformat/avio.c +++ b/libavformat/avio.c @@ -270,7 +270,7 @@ int ffurl_open(URLContext **puc, const char *filename, int flags, const AVIOInterruptCB *int_cb, AVDictionary **options) { int ret = ffurl_alloc(puc, filename, flags, int_cb); - if (ret) + if (ret < 0) return ret; if (options && (*puc)->prot->priv_data_class && (ret = av_opt_set_dict((*puc)->priv_data, options)) < 0) @@ -399,7 +399,7 @@ int avio_check(const char *url, int flags) { URLContext *h; int ret = ffurl_alloc(&h, url, flags, NULL); - if (ret) + if (ret < 0) return ret; if (h->prot->url_check) {