[FFmpeg-devel] [PATCH] lavf/movenc: check ff_mov_init_hinting() return

Matthieu Bouron matthieu.bouron at gmail.com
Thu Jul 4 17:35:41 CEST 2013


Fixes a crash when the codec stream is not supported by the rtp muxer.
---
 libavformat/movenc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 5d224bc..47d1cd7 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -3733,7 +3733,8 @@ static int mov_write_header(AVFormatContext *s)
             AVStream *st = s->streams[i];
             if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO ||
                 st->codec->codec_type == AVMEDIA_TYPE_AUDIO) {
-                ff_mov_init_hinting(s, hint_track, i);
+                if (ff_mov_init_hinting(s, hint_track, i) < 0)
+                    goto error;
                 hint_track++;
             }
         }
-- 
1.8.3.2



More information about the ffmpeg-devel mailing list