Loading media/codecs/m4v_h263/dec/src/vop.cpp +48 −17 Original line number Diff line number Diff line Loading @@ -107,27 +107,58 @@ PV_STATUS DecodeVOLHeader(VideoDecData *video, int layer) #ifndef PV_TOLERATE_VOL_ERRORS if (layer) /* */ { /* support SSPL0-2 */ if (tmpvar != 0x10 && tmpvar != 0x11 && tmpvar != 0x12 && tmpvar != 0xA1 && tmpvar != 0xA2 && tmpvar != 0xA3/* Core SP@L1-L3 */) switch (tmpvar) { /* Simple Scalable Profile Levels */ case 0x10: case 0x11: case 0x12: /* Core Scalable Profile Levels */ case 0xA1: case 0xA2: case 0xA3: // Do Nothing, the cases listed above are supported values break; default: // Unsupport profile level return PV_FAIL; } } else { /* support SPL0-3 & SSPL0-2 */ if (tmpvar != 0x01 && tmpvar != 0x02 && tmpvar != 0x03 && tmpvar != 0x08 && /* While not technically supported, try to decode SPL4&SPL5 files as well. */ /* We'll fail later if the size is too large. This is to allow playback of */ /* some <=CIF files generated by other encoders. */ tmpvar != 0x04 && tmpvar != 0x05 && tmpvar != 0x10 && tmpvar != 0x11 && tmpvar != 0x12 && tmpvar != 0x21 && tmpvar != 0x22 && /* Core Profile Levels */ tmpvar != 0xA1 && tmpvar != 0xA2 && tmpvar != 0xA3 && tmpvar != 0xF0 && tmpvar != 0xF1 && /* Advanced Simple Profile Levels*/ tmpvar != 0xF2 && tmpvar != 0xF3 && tmpvar != 0xF4 && tmpvar != 0xF5) switch (tmpvar) { /* Simple Profile Levels */ case 0x01: case 0x02: case 0x03: case 0x04: case 0x05: case 0x06: case 0x08: case 0x10: case 0x11: case 0x12: /* Core Profile Levels */ case 0x21: case 0x22: case 0xA1: case 0xA2: case 0xA3: /* Advanced Simple Profile Levels*/ case 0xF0: case 0xF1: case 0xF2: case 0xF3: case 0xF4: case 0xF5: // Do Nothing, the cases listed above are supported values break; default: // Unsupport profile level return PV_FAIL; } } #else profile = tmpvar; #endif Loading media/libstagefright/httplive/fuzzer/Android.bp +1 −1 Original line number Diff line number Diff line Loading @@ -40,7 +40,6 @@ cc_fuzz { "libdatasource", "libmedia", "libstagefright", "libutils", ], header_libs: [ "libbase_headers", Loading @@ -53,6 +52,7 @@ cc_fuzz { "libstagefright_foundation", "libhidlbase", "libhidlmemory", "libutils", "android.hidl.allocator@1.0", ], corpus: ["corpus/*"], Loading services/camera/libcameraservice/device3/Camera3Device.cpp +6 −1 Original line number Diff line number Diff line Loading @@ -2857,6 +2857,7 @@ Camera3Device::RequestThread::RequestThread(wp<Camera3Device> parent, mInterface(interface), mListener(nullptr), mId(getId(parent)), mRequestClearing(false), mFirstRepeating(false), mReconfigured(false), mDoPause(false), Loading Loading @@ -3090,6 +3091,7 @@ status_t Camera3Device::RequestThread::clear( *lastFrameNumber = mRepeatingLastFrameNumber; } mRepeatingLastFrameNumber = hardware::camera2::ICameraDeviceUser::NO_IN_FLIGHT_REPEATING_FRAMES; mRequestClearing = true; mRequestSignal.signal(); return OK; } Loading Loading @@ -4218,7 +4220,9 @@ sp<Camera3Device::CaptureRequest> break; } if (!mRequestClearing) { res = mRequestSignal.waitRelative(mRequestLock, kRequestTimeout); } if ((mRequestQueue.empty() && mRepeatingRequests.empty()) || exitPending()) { Loading @@ -4240,6 +4244,7 @@ sp<Camera3Device::CaptureRequest> if (parent != nullptr) { parent->mRequestBufferSM.onRequestThreadPaused(); } mRequestClearing = false; } // Stop waiting for now and let thread management happen return NULL; Loading services/camera/libcameraservice/device3/Camera3Device.h +2 −0 Original line number Diff line number Diff line Loading @@ -982,6 +982,8 @@ class Camera3Device : Mutex mRequestLock; Condition mRequestSignal; bool mRequestClearing; Condition mRequestSubmittedSignal; RequestList mRequestQueue; RequestList mRepeatingRequests; Loading services/mediaresourcemanager/ResourceManagerService.cpp +15 −9 Original line number Diff line number Diff line Loading @@ -483,7 +483,7 @@ Status ResourceManagerService::addResource(int32_t pid, int32_t uid, int64_t cli } } if (info.cookie == 0 && client != nullptr) { info.cookie = addCookieAndLink_l(client->asBinder(), info.cookie = addCookieAndLink_l(client, new DeathNotifier(ref<ResourceManagerService>(), pid, clientId)); } if (mObserverService != nullptr && !resourceAdded.empty()) { Loading Loading @@ -592,7 +592,7 @@ Status ResourceManagerService::removeResource(int pid, int64_t clientId, bool ch onLastRemoved(it->second, info); } removeCookieAndUnlink_l(info.client->asBinder(), info.cookie); removeCookieAndUnlink_l(info.client, info.cookie); if (mObserverService != nullptr && !info.resources.empty()) { mObserverService->onResourceRemoved(info.uid, pid, info.resources); Loading Loading @@ -812,7 +812,7 @@ Status ResourceManagerService::overrideProcessInfo( return Status::fromServiceSpecificError(BAD_VALUE); } uintptr_t cookie = addCookieAndLink_l(client->asBinder(), uintptr_t cookie = addCookieAndLink_l(client, new OverrideProcessInfoDeathNotifier(ref<ResourceManagerService>(), pid)); mProcessInfoOverrideMap.emplace(pid, ProcessInfoOverride{cookie, client}); Loading @@ -820,23 +820,29 @@ Status ResourceManagerService::overrideProcessInfo( return Status::ok(); } uintptr_t ResourceManagerService::addCookieAndLink_l(::ndk::SpAIBinder binder, const sp<DeathNotifier>& notifier) { uintptr_t ResourceManagerService::addCookieAndLink_l( const std::shared_ptr<IResourceManagerClient>& client, const sp<DeathNotifier>& notifier) { if (client == nullptr) { return 0; } std::scoped_lock lock{sCookieLock}; uintptr_t cookie; // Need to skip cookie 0 (if it wraps around). ResourceInfo has cookie initialized to 0 // indicating the death notifier is not created yet. while ((cookie = ++sCookieCounter) == 0); AIBinder_linkToDeath(binder.get(), mDeathRecipient.get(), (void*)cookie); AIBinder_linkToDeath(client->asBinder().get(), mDeathRecipient.get(), (void*)cookie); sCookieToDeathNotifierMap.emplace(cookie, notifier); return cookie; } void ResourceManagerService::removeCookieAndUnlink_l(::ndk::SpAIBinder binder, uintptr_t cookie) { void ResourceManagerService::removeCookieAndUnlink_l( const std::shared_ptr<IResourceManagerClient>& client, uintptr_t cookie) { std::scoped_lock lock{sCookieLock}; AIBinder_unlinkToDeath(binder.get(), mDeathRecipient.get(), (void*)cookie); if (client != nullptr) { AIBinder_unlinkToDeath(client->asBinder().get(), mDeathRecipient.get(), (void*)cookie); } sCookieToDeathNotifierMap.erase(cookie); } Loading @@ -854,7 +860,7 @@ void ResourceManagerService::removeProcessInfoOverride_l(int pid) { mProcessInfo->removeProcessInfoOverride(pid); removeCookieAndUnlink_l(it->second.client->asBinder(), it->second.cookie); removeCookieAndUnlink_l(it->second.client, it->second.cookie); mProcessInfoOverrideMap.erase(pid); } Loading Loading
media/codecs/m4v_h263/dec/src/vop.cpp +48 −17 Original line number Diff line number Diff line Loading @@ -107,27 +107,58 @@ PV_STATUS DecodeVOLHeader(VideoDecData *video, int layer) #ifndef PV_TOLERATE_VOL_ERRORS if (layer) /* */ { /* support SSPL0-2 */ if (tmpvar != 0x10 && tmpvar != 0x11 && tmpvar != 0x12 && tmpvar != 0xA1 && tmpvar != 0xA2 && tmpvar != 0xA3/* Core SP@L1-L3 */) switch (tmpvar) { /* Simple Scalable Profile Levels */ case 0x10: case 0x11: case 0x12: /* Core Scalable Profile Levels */ case 0xA1: case 0xA2: case 0xA3: // Do Nothing, the cases listed above are supported values break; default: // Unsupport profile level return PV_FAIL; } } else { /* support SPL0-3 & SSPL0-2 */ if (tmpvar != 0x01 && tmpvar != 0x02 && tmpvar != 0x03 && tmpvar != 0x08 && /* While not technically supported, try to decode SPL4&SPL5 files as well. */ /* We'll fail later if the size is too large. This is to allow playback of */ /* some <=CIF files generated by other encoders. */ tmpvar != 0x04 && tmpvar != 0x05 && tmpvar != 0x10 && tmpvar != 0x11 && tmpvar != 0x12 && tmpvar != 0x21 && tmpvar != 0x22 && /* Core Profile Levels */ tmpvar != 0xA1 && tmpvar != 0xA2 && tmpvar != 0xA3 && tmpvar != 0xF0 && tmpvar != 0xF1 && /* Advanced Simple Profile Levels*/ tmpvar != 0xF2 && tmpvar != 0xF3 && tmpvar != 0xF4 && tmpvar != 0xF5) switch (tmpvar) { /* Simple Profile Levels */ case 0x01: case 0x02: case 0x03: case 0x04: case 0x05: case 0x06: case 0x08: case 0x10: case 0x11: case 0x12: /* Core Profile Levels */ case 0x21: case 0x22: case 0xA1: case 0xA2: case 0xA3: /* Advanced Simple Profile Levels*/ case 0xF0: case 0xF1: case 0xF2: case 0xF3: case 0xF4: case 0xF5: // Do Nothing, the cases listed above are supported values break; default: // Unsupport profile level return PV_FAIL; } } #else profile = tmpvar; #endif Loading
media/libstagefright/httplive/fuzzer/Android.bp +1 −1 Original line number Diff line number Diff line Loading @@ -40,7 +40,6 @@ cc_fuzz { "libdatasource", "libmedia", "libstagefright", "libutils", ], header_libs: [ "libbase_headers", Loading @@ -53,6 +52,7 @@ cc_fuzz { "libstagefright_foundation", "libhidlbase", "libhidlmemory", "libutils", "android.hidl.allocator@1.0", ], corpus: ["corpus/*"], Loading
services/camera/libcameraservice/device3/Camera3Device.cpp +6 −1 Original line number Diff line number Diff line Loading @@ -2857,6 +2857,7 @@ Camera3Device::RequestThread::RequestThread(wp<Camera3Device> parent, mInterface(interface), mListener(nullptr), mId(getId(parent)), mRequestClearing(false), mFirstRepeating(false), mReconfigured(false), mDoPause(false), Loading Loading @@ -3090,6 +3091,7 @@ status_t Camera3Device::RequestThread::clear( *lastFrameNumber = mRepeatingLastFrameNumber; } mRepeatingLastFrameNumber = hardware::camera2::ICameraDeviceUser::NO_IN_FLIGHT_REPEATING_FRAMES; mRequestClearing = true; mRequestSignal.signal(); return OK; } Loading Loading @@ -4218,7 +4220,9 @@ sp<Camera3Device::CaptureRequest> break; } if (!mRequestClearing) { res = mRequestSignal.waitRelative(mRequestLock, kRequestTimeout); } if ((mRequestQueue.empty() && mRepeatingRequests.empty()) || exitPending()) { Loading @@ -4240,6 +4244,7 @@ sp<Camera3Device::CaptureRequest> if (parent != nullptr) { parent->mRequestBufferSM.onRequestThreadPaused(); } mRequestClearing = false; } // Stop waiting for now and let thread management happen return NULL; Loading
services/camera/libcameraservice/device3/Camera3Device.h +2 −0 Original line number Diff line number Diff line Loading @@ -982,6 +982,8 @@ class Camera3Device : Mutex mRequestLock; Condition mRequestSignal; bool mRequestClearing; Condition mRequestSubmittedSignal; RequestList mRequestQueue; RequestList mRepeatingRequests; Loading
services/mediaresourcemanager/ResourceManagerService.cpp +15 −9 Original line number Diff line number Diff line Loading @@ -483,7 +483,7 @@ Status ResourceManagerService::addResource(int32_t pid, int32_t uid, int64_t cli } } if (info.cookie == 0 && client != nullptr) { info.cookie = addCookieAndLink_l(client->asBinder(), info.cookie = addCookieAndLink_l(client, new DeathNotifier(ref<ResourceManagerService>(), pid, clientId)); } if (mObserverService != nullptr && !resourceAdded.empty()) { Loading Loading @@ -592,7 +592,7 @@ Status ResourceManagerService::removeResource(int pid, int64_t clientId, bool ch onLastRemoved(it->second, info); } removeCookieAndUnlink_l(info.client->asBinder(), info.cookie); removeCookieAndUnlink_l(info.client, info.cookie); if (mObserverService != nullptr && !info.resources.empty()) { mObserverService->onResourceRemoved(info.uid, pid, info.resources); Loading Loading @@ -812,7 +812,7 @@ Status ResourceManagerService::overrideProcessInfo( return Status::fromServiceSpecificError(BAD_VALUE); } uintptr_t cookie = addCookieAndLink_l(client->asBinder(), uintptr_t cookie = addCookieAndLink_l(client, new OverrideProcessInfoDeathNotifier(ref<ResourceManagerService>(), pid)); mProcessInfoOverrideMap.emplace(pid, ProcessInfoOverride{cookie, client}); Loading @@ -820,23 +820,29 @@ Status ResourceManagerService::overrideProcessInfo( return Status::ok(); } uintptr_t ResourceManagerService::addCookieAndLink_l(::ndk::SpAIBinder binder, const sp<DeathNotifier>& notifier) { uintptr_t ResourceManagerService::addCookieAndLink_l( const std::shared_ptr<IResourceManagerClient>& client, const sp<DeathNotifier>& notifier) { if (client == nullptr) { return 0; } std::scoped_lock lock{sCookieLock}; uintptr_t cookie; // Need to skip cookie 0 (if it wraps around). ResourceInfo has cookie initialized to 0 // indicating the death notifier is not created yet. while ((cookie = ++sCookieCounter) == 0); AIBinder_linkToDeath(binder.get(), mDeathRecipient.get(), (void*)cookie); AIBinder_linkToDeath(client->asBinder().get(), mDeathRecipient.get(), (void*)cookie); sCookieToDeathNotifierMap.emplace(cookie, notifier); return cookie; } void ResourceManagerService::removeCookieAndUnlink_l(::ndk::SpAIBinder binder, uintptr_t cookie) { void ResourceManagerService::removeCookieAndUnlink_l( const std::shared_ptr<IResourceManagerClient>& client, uintptr_t cookie) { std::scoped_lock lock{sCookieLock}; AIBinder_unlinkToDeath(binder.get(), mDeathRecipient.get(), (void*)cookie); if (client != nullptr) { AIBinder_unlinkToDeath(client->asBinder().get(), mDeathRecipient.get(), (void*)cookie); } sCookieToDeathNotifierMap.erase(cookie); } Loading @@ -854,7 +860,7 @@ void ResourceManagerService::removeProcessInfoOverride_l(int pid) { mProcessInfo->removeProcessInfoOverride(pid); removeCookieAndUnlink_l(it->second.client->asBinder(), it->second.cookie); removeCookieAndUnlink_l(it->second.client, it->second.cookie); mProcessInfoOverrideMap.erase(pid); } Loading