[FFmpeg-cvslog] av_probe_input_format3: support NULL as buffer. Fixes null ptr deref

Michael Niedermayer git at videolan.org
Tue Nov 13 22:25:47 CET 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Tue Nov 13 22:20:44 2012 +0100| [af9ec3dd1d9e90ec8134b01074b7beb01a1beb1a] | committer: Michael Niedermayer

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 at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=af9ec3dd1d9e90ec8134b01074b7beb01a1beb1a
---

 libavformat/utils.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavformat/utils.c b/libavformat/utils.c
index 0240b0c..4072ac8 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);



More information about the ffmpeg-cvslog mailing list