smoothstreamingenc: Check the output UrlContext before accessing it
authorMartin Storsjö <martin@martin.st>
Fri, 5 Oct 2012 23:24:07 +0000 (02:24 +0300)
committerMartin Storsjö <martin@martin.st>
Sat, 6 Oct 2012 10:05:30 +0000 (13:05 +0300)
This code can be called with a NULL UrlContext if writing of the
trailer involves seeking.

Signed-off-by: Martin Storsjö <martin@martin.st>
libavformat/smoothstreamingenc.c

index 339a9bb08d5830e50f086a386bc6228d1cb919c6..7ee640a9319bfdaf289c7610de2197b21347c71e 100644 (file)
@@ -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;
     }