Commit 072b0670 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

decomp: handle memory error

parent 90f46a51
...@@ -95,7 +95,7 @@ static void *Thread (void *data) ...@@ -95,7 +95,7 @@ static void *Thread (void *data)
stream_t *stream = data; stream_t *stream = data;
stream_sys_t *p_sys = stream->p_sys; stream_sys_t *p_sys = stream->p_sys;
#ifdef HAVE_VMSPLICE #ifdef HAVE_VMSPLICE
ssize_t page_mask = sysconf (_SC_PAGE_SIZE) - 1; const ssize_t page_mask = sysconf (_SC_PAGE_SIZE) - 1;
#endif #endif
int fd = p_sys->write_fd; int fd = p_sys->write_fd;
bool error = false; bool error = false;
...@@ -107,6 +107,8 @@ static void *Thread (void *data) ...@@ -107,6 +107,8 @@ static void *Thread (void *data)
#ifdef HAVE_VMSPLICE #ifdef HAVE_VMSPLICE
unsigned char *buf = mmap (NULL, bufsize, PROT_READ|PROT_WRITE, unsigned char *buf = mmap (NULL, bufsize, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_ANONYMOUS, -1, 0); MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);
if (unlikely(buf == MAP_FAILED))
break;
vlc_cleanup_push (cleanup_mmap, buf); vlc_cleanup_push (cleanup_mmap, buf);
#else #else
unsigned char buf[bufsize]; unsigned char buf[bufsize];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment