ahc: fix potential NULL deref
authorMartin Kelly <martin@surround.io>
Thu, 19 May 2016 16:25:57 +0000 (09:25 -0700)
committerSebastian Dröge <sebastian@centricular.com>
Fri, 20 May 2016 06:16:28 +0000 (09:16 +0300)
commit8c236a9f2e681fa4756a9781b35fc53c1380cf61
treee693ad33d213b64b126d902b3a301a39d2d00c21
parent537ba5d1091baa3ac7273eabf4b4d60b37304fce
ahc: fix potential NULL deref

This bug was found via cppcheck static analysis.

If android.hardware.Camera.getParameters returns NULL, then object will
be NULL, and we won't allocate params. This means that the GST_DEBUG
statement referencing params->object will be invalid. Fix this by
exiting early if android.hardware.Camera.getParameters returns NULL.

https://bugzilla.gnome.org/show_bug.cgi?id=766638
sys/androidmedia/gst-android-hardware-camera.c