[libav-stable] oggenc: remove unneeded null check

Michael Niedermayer git at libav.org
Wed Oct 29 17:55:50 CET 2014


Module: libav
Branch: master
Commit: b3d11437ca55d81eeb10c923343ad69b73895fa8

Author:    Michael Niedermayer <michaelni at gmx.at>
Committer: Vittorio Giovara <vittorio.giovara at gmail.com>
Date:      Fri Oct 24 13:15:37 2014 +0100

oggenc: remove unneeded null check

The code would have segfaulted before if oggstream were NULL.

CC: libav-stable at libav.org
Bug-Id: CID 732218

---

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

diff --git a/libavformat/oggenc.c b/libavformat/oggenc.c
index 1277a8b..8f08da1 100644
--- a/libavformat/oggenc.c
+++ b/libavformat/oggenc.c
@@ -530,7 +530,7 @@ static int ogg_write_header(AVFormatContext *s)
         AVStream *st = s->streams[j];
         OGGStreamContext *oggstream = st->priv_data;
         for (i = 1; i < 3; i++) {
-            if (oggstream && oggstream->header_len[i])
+            if (oggstream->header_len[i])
                 ogg_buffer_data(s, st, oggstream->header[i],
                                 oggstream->header_len[i], 0, 1);
         }



More information about the libav-stable mailing list