mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-02-16 11:47:04 +00:00
avformat/avio: Avoid av_strdup(NULL)
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
parent
c856e4c546
commit
fed46d7706
@ -436,15 +436,19 @@ int ffio_fdopen(AVIOContext **sp, URLContext *h)
|
|||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
}
|
}
|
||||||
s = *sp;
|
s = *sp;
|
||||||
s->protocol_whitelist = av_strdup(h->protocol_whitelist);
|
if (h->protocol_whitelist) {
|
||||||
if (!s->protocol_whitelist && h->protocol_whitelist) {
|
s->protocol_whitelist = av_strdup(h->protocol_whitelist);
|
||||||
avio_closep(sp);
|
if (!s->protocol_whitelist) {
|
||||||
return AVERROR(ENOMEM);
|
avio_closep(sp);
|
||||||
|
return AVERROR(ENOMEM);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
s->protocol_blacklist = av_strdup(h->protocol_blacklist);
|
if (h->protocol_blacklist) {
|
||||||
if (!s->protocol_blacklist && h->protocol_blacklist) {
|
s->protocol_blacklist = av_strdup(h->protocol_blacklist);
|
||||||
avio_closep(sp);
|
if (!s->protocol_blacklist) {
|
||||||
return AVERROR(ENOMEM);
|
avio_closep(sp);
|
||||||
|
return AVERROR(ENOMEM);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
s->direct = h->flags & AVIO_FLAG_DIRECT;
|
s->direct = h->flags & AVIO_FLAG_DIRECT;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user