[FFmpeg-cvslog] lxfdec: fix "no audio stream" check. avoid null ptrs deref

Michael Niedermayer git at videolan.org
Wed Nov 14 00:07:09 CET 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Tue Nov 13 23:03:38 2012 +0100| [1f1960519a1700985b5f645a2950c10581f78a73] | committer: Michael Niedermayer

lxfdec: fix "no audio stream" check. avoid null ptrs 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=1f1960519a1700985b5f645a2950c10581f78a73
---

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

diff --git a/libavformat/lxfdec.c b/libavformat/lxfdec.c
index bf17d87..dbb5f53 100644
--- a/libavformat/lxfdec.c
+++ b/libavformat/lxfdec.c
@@ -165,7 +165,7 @@ static int get_packet_header(AVFormatContext *s)
         break;
     case 1:
         //audio
-        if (!(st = s->streams[1])) {
+        if (!s->streams || !(st = s->streams[1])) {
             av_log(s, AV_LOG_INFO, "got audio packet, but no audio stream present\n");
             break;
         }



More information about the ffmpeg-cvslog mailing list