file: Fix mmap error check.
authorMichael Niedermayer <michaelni@gmx.at>
Wed, 4 May 2011 22:52:03 +0000 (00:52 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 4 May 2011 22:52:03 +0000 (00:52 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavutil/file.c

index b2d380d..1fb7a2b 100644 (file)
@@ -75,7 +75,7 @@ int av_file_map(const char *filename, uint8_t **bufptr, size_t *size,
 
 #if HAVE_MMAP
     ptr = mmap(NULL, *size, PROT_READ|PROT_WRITE, MAP_PRIVATE, fd, 0);
-    if ((int)(ptr) == -1) {
+    if (ptr == (void*)-1) {
         err = AVERROR(errno);
         av_strerror(err, errbuf, sizeof(errbuf));
         av_log(&file_log_ctx, AV_LOG_ERROR, "Error occurred in mmap(): %s\n", errbuf);