url_check does not guarantee url_open will be called before
(and actually it is not designed to do so)
If url_open is not called before url_check called, ffs
will be null causing the crash.
Change-Id: I0176c619eeb931ede0061003e396ee7e1407b860
(cherry picked from commit
832d93744cccf1f056f7ecdad6041e91148e9260)
FFSource* ffs = (FFSource*)h->priv_data;
ALOGV("android source close");
delete ffs;
+ h->priv_data = NULL;
return 0;
}
{
FFSource* ffs = (FFSource*)h->priv_data;
- if (ffs->init_check() < 0)
+ /* url_check does not guarantee url_open will be called
+ * (and actually it is not designed to do so)
+ * If url_open is not called before url_check called, ffs
+ * will be null, and we will assume everything is ok.
+ */
+ if (ffs && (ffs->init_check() < 0))
return AVERROR(EACCES); // FIXME
return (mask & AVIO_FLAG_READ);