libudfread | branch: master | Petri Hintukainen <[email protected]> | Sat Jun 
24 12:34:29 2017 +0300| [0e53642cccd9f6e485ddab7eaa0f24f98cf6fe24] | committer: 
Petri Hintukainen

Check malloc result

> http://git.videolan.org/gitweb.cgi/libudfread.git/?a=commit;h=0e53642cccd9f6e485ddab7eaa0f24f98cf6fe24
---

 src/udfread.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/udfread.c b/src/udfread.c
index d3cde6c..f809d61 100644
--- a/src/udfread.c
+++ b/src/udfread.c
@@ -1599,6 +1599,9 @@ ssize_t udfread_file_read(UDFFILE *p, void *buf, size_t 
bytes)
     /* allocate temp storage for input block */
     if (!p->block) {
         p->block_mem = malloc(2 * UDF_BLOCK_SIZE);
+        if (!p->block_mem) {
+            return -1;
+        }
         p->block = ALIGN(p->block_mem, UDF_BLOCK_SIZE);
     }
 

_______________________________________________
libbluray-devel mailing list
[email protected]
https://mailman.videolan.org/listinfo/libbluray-devel

Reply via email to