[FFmpeg-cvslog] smoothstreamingenc: Check the output UrlContext before accessing it

Martin Storsjö git at videolan.org
Sun Oct 7 11:43:24 CEST 2012


ffmpeg | branch: master | Martin Storsjö <martin at martin.st> | Sat Oct  6 02:24:07 2012 +0300| [eb2f391018facf1e31e88800f3109b382da3f59c] | committer: Martin Storsjö

smoothstreamingenc: Check the output UrlContext before accessing it

This code can be called with a NULL UrlContext if writing of the
trailer involves seeking.

Signed-off-by: Martin Storsjö <martin at martin.st>

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

 libavformat/smoothstreamingenc.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavformat/smoothstreamingenc.c b/libavformat/smoothstreamingenc.c
index 339a9bb..7ee640a 100644
--- a/libavformat/smoothstreamingenc.c
+++ b/libavformat/smoothstreamingenc.c
@@ -108,7 +108,8 @@ static int64_t ism_seek(void *opaque, int64_t offset, int whence)
         os->tail_out = NULL;
     }
     if (offset >= os->cur_start_pos) {
-        ffurl_seek(os->out, offset - os->cur_start_pos, SEEK_SET);
+        if (os->out)
+            ffurl_seek(os->out, offset - os->cur_start_pos, SEEK_SET);
         os->cur_pos = offset;
         return offset;
     }



More information about the ffmpeg-cvslog mailing list