shithub: aacdec

Download patch

ref: 5cc622b87a85467a804572f9b621b5a1d63ee3d8
parent: 25fbe5d61b3745fd0f00d962334232b72e09b644
author: Fabian Greffrath <fabian@greffrath.com>
date: Thu Apr 23 19:48:05 EDT 2020

mp4read_open: add check for failed frame buffer allocation

Fixes the first part of #49, thanks @jinhojun.

--- a/frontend/mp4read.c
+++ b/frontend/mp4read.c
@@ -1002,8 +1002,10 @@
     }
 
     // alloc frame buffer
-    // fixme: error checking
     mp4config.bitbuf.data = malloc(mp4config.frame.maxsize);
+
+    if (!mp4config.bitbuf.data)
+        goto err;
 
     if (mp4config.verbose.header)
     {