Commit 2ba6d7cb authored by Pan Bian's avatar Pan Bian Committed by Michael Niedermayer

ffmpeg: Check read_ffserver_streams() return value

The function avformat_alloc_context() will return a NULL pointer on
failure. However, in function read_ffserver_streams(), its return value
is not validated and the subsequent dereference may result in a bad
memory access bug. Check its return value against NULL and avoid
potential NULL dereference.
Signed-off-by: 's avatarPan Bian <bianpan2016@163.com>
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 5b4baf15
......@@ -2000,6 +2000,8 @@ static int read_ffserver_streams(OptionsContext *o, AVFormatContext *s, const ch
{
int i, err;
AVFormatContext *ic = avformat_alloc_context();
if (!ic)
return AVERROR(ENOMEM);
ic->interrupt_callback = int_cb;
err = avformat_open_input(&ic, filename, NULL, NULL);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment