[FFmpeg-cvslog] matroskadec: fix null pointer dereference

Michael Niedermayer git at videolan.org
Sat Apr 14 20:21:08 CEST 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sat Apr 14 19:33:24 2012 +0200| [0b27136c65c1b4fab29b5b354e1f470f974bc310] | committer: Michael Niedermayer

matroskadec: fix null pointer dereference

Fixes: Ticket1206
Found-by: John Villamil
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavformat/matroskadec.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index 2205af6..e9c3101 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -1581,9 +1581,11 @@ static int matroska_read_header(AVFormatContext *s)
         } else if (codec_id == CODEC_ID_RA_144) {
             track->audio.out_samplerate = 8000;
             track->audio.channels = 1;
-        } else if (codec_id == CODEC_ID_RA_288 || codec_id == CODEC_ID_COOK ||
-                   codec_id == CODEC_ID_ATRAC3 || codec_id == CODEC_ID_SIPR) {
+        } else if ((codec_id == CODEC_ID_RA_288 || codec_id == CODEC_ID_COOK ||
+                    codec_id == CODEC_ID_ATRAC3 || codec_id == CODEC_ID_SIPR)
+                    && track->codec_priv.data) {
             int flavor;
+
             ffio_init_context(&b, track->codec_priv.data,track->codec_priv.size,
                           0, NULL, NULL, NULL, NULL);
             avio_skip(&b, 22);



More information about the ffmpeg-cvslog mailing list