From 1512587eb162be68b62161371a4ad1ce81b5377b Mon Sep 17 00:00:00 2001 From: Steve Kondik Date: Sun, 13 Dec 2015 16:01:02 -0800 Subject: stagefright: Check vendor list for allowed encoders Change-Id: Ie9ff0d275fc5f853c18fe4d5e590443d0c316e99 --- media/libmediaplayerservice/StagefrightRecorder.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/media/libmediaplayerservice/StagefrightRecorder.cpp b/media/libmediaplayerservice/StagefrightRecorder.cpp index 81d8e7b..6baca4d 100644 --- a/media/libmediaplayerservice/StagefrightRecorder.cpp +++ b/media/libmediaplayerservice/StagefrightRecorder.cpp @@ -185,7 +185,8 @@ status_t StagefrightRecorder::setAudioEncoder(audio_encoder ae) { status_t StagefrightRecorder::setVideoEncoder(video_encoder ve) { ALOGV("setVideoEncoder: %d", ve); if (ve < VIDEO_ENCODER_DEFAULT || - ve >= VIDEO_ENCODER_LIST_END) { + (ve >= VIDEO_ENCODER_LIST_END && ve <= VIDEO_ENCODER_LIST_VENDOR_START) || + ve >= VIDEO_ENCODER_LIST_VENDOR_END) { ALOGE("Invalid video encoder: %d", ve); return BAD_VALUE; } -- cgit v1.1