changeset 5654:2f09b8dc4e08 libavformat

Do not call lseek() with invalid whence value
author mru
date Sat, 13 Feb 2010 16:56:37 +0000
parents 25eca7e2cf64
children aa15ce84d338
files file.c
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/file.c	Fri Feb 12 20:35:29 2010 +0000
+++ b/file.c	Sat Feb 13 16:56:37 2010 +0000
@@ -73,6 +73,8 @@
 static int64_t file_seek(URLContext *h, int64_t pos, int whence)
 {
     int fd = (intptr_t) h->priv_data;
+    if (whence != SEEK_SET && whence != SEEK_CUR && whence != SEEK_END)
+        return AVERROR_NOTSUPP;
     return lseek(fd, pos, whence);
 }