From 10ff2967ea8d17f7e46599497214280a21ca409a Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Thu, 5 May 2011 00:52:03 +0200 Subject: [PATCH] file: Fix mmap error check. Signed-off-by: Michael Niedermayer --- libavutil/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavutil/file.c b/libavutil/file.c index b2d380df9d..1fb7a2b5c9 100644 --- a/libavutil/file.c +++ b/libavutil/file.c @@ -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);