diff options
author | wm4 <wm4@nowhere> | 2014-12-12 17:28:22 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-12-12 17:28:22 +0100 |
commit | 2b337d67a472cf88c9b1a4ee7da07820b8e4a5c9 (patch) | |
tree | f22031e5f6ea6df946375749fc5600d3a32bc65a /demux/demux_lavf.c | |
parent | 5012e5156d0094f33d85caf03db1b368a6456520 (diff) | |
download | mpv-2b337d67a472cf88c9b1a4ee7da07820b8e4a5c9.tar.bz2 mpv-2b337d67a472cf88c9b1a4ee7da07820b8e4a5c9.tar.xz |
Check some mallocs
Fixes #1337.
Diffstat (limited to 'demux/demux_lavf.c')
-rw-r--r-- | demux/demux_lavf.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/demux/demux_lavf.c b/demux/demux_lavf.c index 62dcdf3655..e1800295cc 100644 --- a/demux/demux_lavf.c +++ b/demux/demux_lavf.c @@ -286,6 +286,8 @@ static int lavf_check_file(demuxer_t *demuxer, enum demux_check check) .buf_size = 0, .buf = av_mallocz(PROBE_BUF_SIZE + FF_INPUT_BUFFER_PADDING_SIZE), }; + if (!avpd.buf) + return -1; bool final_probe = false; do { @@ -679,6 +681,8 @@ static int demux_open_lavf(demuxer_t *demuxer, enum demux_check check) return -1; avfc = avformat_alloc_context(); + if (!avfc) + return -1; if (lavfdopts->cryptokey) parse_cryptokey(avfc, lavfdopts->cryptokey); |