[FFmpeg-cvslog] file: Fix mmap error check.
Reimar Döffinger
Reimar.Doeffinger at gmx.de
Thu May 5 07:31:38 CEST 2011
On Thu, May 05, 2011 at 02:29:57AM +0200, Michael Niedermayer wrote:
> ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Thu May 5 00:52:03 2011 +0200| [10ff2967ea8d17f7e46599497214280a21ca409a] | committer: Michael Niedermayer
>
> file: Fix mmap error check.
> Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
>
> > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=10ff2967ea8d17f7e46599497214280a21ca409a
> ---
>
> libavutil/file.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/libavutil/file.c b/libavutil/file.c
> index b2d380d..1fb7a2b 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) {
IMO MAP_FAILED is nicer.
More information about the ffmpeg-cvslog
mailing list