mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-18 13:35:13 +00:00
yop: check return value of avformat_new_stream()
Fixes null pointer dereference, fixes CID703729.
Signed-off-by: Paul B Mahol <onemda@gmail.com>
(cherry picked from commit 3d179edf6d
)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
e6dfaf7bb8
commit
46c1e5de58
@ -59,6 +59,8 @@ static int yop_read_header(AVFormatContext *s, AVFormatParameters *ap)
|
|||||||
|
|
||||||
audio_stream = avformat_new_stream(s, NULL);
|
audio_stream = avformat_new_stream(s, NULL);
|
||||||
video_stream = avformat_new_stream(s, NULL);
|
video_stream = avformat_new_stream(s, NULL);
|
||||||
|
if (!audio_stream || !video_stream)
|
||||||
|
return AVERROR(ENOMEM);
|
||||||
|
|
||||||
// Extra data that will be passed to the decoder
|
// Extra data that will be passed to the decoder
|
||||||
video_stream->codec->extradata_size = 8;
|
video_stream->codec->extradata_size = 8;
|
||||||
|
Loading…
Reference in New Issue
Block a user