Browse Source

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 <lukasz.m.luki@gmail.com>
tags/n2.3
Lukasz Marek 11 years ago
parent
commit
f495fbe76a
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      libavformat/avio.c

+ 2
- 2
libavformat/avio.c View File

@@ -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) {


Loading…
Cancel
Save