[FFmpeg-cvslog] sdp: Check that fmt->oformat is non-null before accessing it

Martin Storsjö git at videolan.org
Sun Jan 12 15:52:49 CET 2014


ffmpeg | branch: release/1.1 | Martin Storsjö <martin at martin.st> | Fri Jan  3 15:47:02 2014 +0200| [12479588d7894a6d9827c53d89f235e006b95533] | committer: Reinhard Tartler

sdp: Check that fmt->oformat is non-null before accessing it

This avoids crashes when avserver tries to create an SDP, since
d77f4af.

Addresses: CVE-2012-6617

CC: libav-stable at libav.org
Signed-off-by: Martin Storsjö <martin at martin.st>
(cherry picked from commit 82b9799bb211ecd117171115e4a8b832c4942314)
Signed-off-by: Reinhard Tartler <siretart at tauware.de>

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

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

diff --git a/libavformat/sdp.c b/libavformat/sdp.c
index 57044d4..e6e6f82 100644
--- a/libavformat/sdp.c
+++ b/libavformat/sdp.c
@@ -402,7 +402,7 @@ static char *sdp_write_media_attributes(char *buff, int size, AVCodecContext *c,
     switch (c->codec_id) {
         case AV_CODEC_ID_H264: {
             int mode = 1;
-            if (fmt && fmt->oformat->priv_class &&
+            if (fmt && fmt->oformat && fmt->oformat->priv_class &&
                 av_opt_flag_is_set(fmt->priv_data, "rtpflags", "h264_mode0"))
                 mode = 0;
             if (c->extradata_size) {



More information about the ffmpeg-cvslog mailing list