diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-11-13 22:20:44 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-11-13 22:21:10 +0100 |
commit | af9ec3dd1d9e90ec8134b01074b7beb01a1beb1a (patch) | |
tree | 48708cd2dbc84d7fb0770a742cb26e02f323b53d /libavformat | |
parent | 001af703c6bff7cb8009db3ac882b8d929d67d9e (diff) | |
download | ffmpeg-af9ec3dd1d9e90ec8134b01074b7beb01a1beb1a.tar.gz |
av_probe_input_format3: support NULL as buffer. Fixes null ptr deref
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/utils.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c index 0240b0c3b5..4072ac8a8e 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -295,6 +295,10 @@ AVInputFormat *av_probe_input_format3(AVProbeData *pd, int is_opened, int *score AVProbeData lpd = *pd; AVInputFormat *fmt1 = NULL, *fmt; int score, nodat = 0, score_max=0; + const static uint8_t zerobuffer[AVPROBE_PADDING_SIZE]; + + if (!lpd.buf) + lpd.buf = zerobuffer; if (lpd.buf_size > 10 && ff_id3v2_match(lpd.buf, ID3v2_DEFAULT_MAGIC)) { int id3len = ff_id3v2_tag_len(lpd.buf); |