From a2081368e2068a86f2db9b0dd562d9e18f69ea37 Mon Sep 17 00:00:00 2001 From: Andy McFadden Date: Wed, 14 Aug 2013 15:08:29 -0700 Subject: Another error check Change-Id: I01ed5c0c7dcb520732d2856859bced31df5fbbb5 --- cmds/screenrecord/screenrecord.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'cmds') diff --git a/cmds/screenrecord/screenrecord.cpp b/cmds/screenrecord/screenrecord.cpp index c904b03..a5fbe16 100644 --- a/cmds/screenrecord/screenrecord.cpp +++ b/cmds/screenrecord/screenrecord.cpp @@ -143,6 +143,10 @@ static status_t prepareEncoder(float displayFps, sp* pCodec, looper->start(); ALOGV("Creating codec"); sp codec = MediaCodec::CreateByType(looper, "video/avc", true); + if (codec == NULL) { + fprintf(stderr, "ERROR: unable to create video/avc codec instance\n"); + return UNKNOWN_ERROR; + } err = codec->configure(format, NULL, NULL, MediaCodec::CONFIGURE_FLAG_ENCODE); if (err != NO_ERROR) { -- cgit v1.1