From: Michal Sojka Date: Sat, 8 May 2010 19:49:53 +0000 (+0200) Subject: url_fseek works X-Git-Url: http://rtime.felk.cvut.cz/gitweb/frescor/ffmpeg.git/commitdiff_plain/a4582fb42456fe83734835ecc73d5a9b2ec2aba3 url_fseek works --- diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c index c18e9a030..5a67959a8 100644 --- a/libavformat/aviobuf.c +++ b/libavformat/aviobuf.c @@ -607,9 +607,10 @@ int url_fdopen(ByteIOContext **s, URLContext *h) buffer_size = IO_BUFFER_SIZE; } if (h->flags & URL_DIRECT) { + if ((h->flags & URL_RDWR) == 0) + return AVERROR(EINVAL); /* We need read beacuse of url_fseek() */ buffer_size = 2*buffer_size+BLOCK_SIZE; buffer = memalign(sysconf(_SC_PAGESIZE), buffer_size); - ; } else { buffer = av_malloc(buffer_size); }