[FFmpeg-cvslog] read_gab2_sub: fix null pointer dereference

Michael Niedermayer git at videolan.org
Wed Dec 12 17:58:34 CET 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Wed Dec 12 14:27:46 2012 +0100| [028cc42a1638e6f93a857f11c2568d1c3a51e612] | committer: Michael Niedermayer

read_gab2_sub: fix null pointer dereference

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=028cc42a1638e6f93a857f11c2568d1c3a51e612
---

 libavformat/avidec.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/avidec.c b/libavformat/avidec.c
index 974071c..7436b63 100644
--- a/libavformat/avidec.c
+++ b/libavformat/avidec.c
@@ -817,7 +817,7 @@ static int avi_read_header(AVFormatContext *s)
 }
 
 static int read_gab2_sub(AVStream *st, AVPacket *pkt) {
-    if (!strcmp(pkt->data, "GAB2") && AV_RL16(pkt->data+5) == 2) {
+    if (pkt->data && !strcmp(pkt->data, "GAB2") && AV_RL16(pkt->data+5) == 2) {
         uint8_t desc[256];
         int score = AVPROBE_SCORE_MAX / 2, ret;
         AVIStream *ast = st->priv_data;



More information about the ffmpeg-cvslog mailing list