Fix a segfault when handling errors or .asx or .ram files. Silly bug
authorPhilip Gladstone <philipjsg@users.sourceforge.net>
Mon, 20 May 2002 03:02:09 +0000 (03:02 +0000)
committerPhilip Gladstone <philipjsg@users.sourceforge.net>
Mon, 20 May 2002 03:02:09 +0000 (03:02 +0000)
on my part.

Originally committed as revision 536 to svn://svn.ffmpeg.org/ffmpeg/trunk

ffserver.c

index 67a402a852c1376e2177e49c8ee2cd3092959d12..4e34f930655de82f8bed8034371e13a16455ba4f 100644 (file)
@@ -400,7 +400,8 @@ static int handle_http(HTTPContext *c, long cur_time)
             }
         } else {
             c->buffer_ptr += len;
-            c->stream->bytes_served += len;
+            if (c->stream)
+                c->stream->bytes_served += len;
             c->data_count += len;
             if (c->buffer_ptr >= c->buffer_end) {
                 /* if error, exit */
@@ -1225,7 +1226,8 @@ static int http_send_data(HTTPContext *c)
         } else {
             c->buffer_ptr += len;
             c->data_count += len;
-            c->stream->bytes_served += len;
+            if (c->stream)
+                c->stream->bytes_served += len;
         }
     }
     return 0;