[vlc-commits] mmal: don't use a pointer if allocation failed
Steve Lhomme
git at videolan.org
Fri Jan 10 16:42:29 CET 2020
vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Fri Jan 10 11:50:47 2020 +0100| [c1e78b3c80b9cdaf0fab12ee60f69eeb25e44c3a] | committer: Steve Lhomme
mmal: don't use a pointer if allocation failed
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c1e78b3c80b9cdaf0fab12ee60f69eeb25e44c3a
---
modules/hw/mmal/vout.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/modules/hw/mmal/vout.c b/modules/hw/mmal/vout.c
index 0fdbc6ce6f..66701e3ca7 100644
--- a/modules/hw/mmal/vout.c
+++ b/modules/hw/mmal/vout.c
@@ -521,6 +521,9 @@ static picture_pool_t *vd_pool(vout_display_t *vd, unsigned count)
sys->pictures = calloc(sys->num_buffers, sizeof(picture_t *));
for (i = 0; i < sys->num_buffers; ++i) {
picture_sys_t *p_sys = picture_res.p_sys = calloc(1, sizeof(picture_sys_t));
+ if (unlikely(p_sys==NULL)) {
+ goto out;
+ }
p_sys->owner = (vlc_object_t *)vd;
p_sys->buffer = mmal_queue_get(sys->pool->queue);
More information about the vlc-commits
mailing list