mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-02-02 20:00:35 +00:00
Avoid a crash when a bad video stream is specified.
This commit is contained in:
parent
f20663e530
commit
bbe13f1d74
@ -15,8 +15,9 @@
|
||||
// Official git repository and contact information can be found at
|
||||
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
|
||||
|
||||
#include "MediaEngine.h"
|
||||
#include "../MemMap.h"
|
||||
#include "Core/HW/MediaEngine.h"
|
||||
#include "Core/MemMap.h"
|
||||
#include "Core/Reporting.h"
|
||||
#include "GPU/GPUInterface.h"
|
||||
#include "Core/HW/atrac3plus.h"
|
||||
|
||||
@ -221,6 +222,11 @@ bool MediaEngine::openContext() {
|
||||
if(avformat_find_stream_info(m_pFormatCtx, NULL) < 0)
|
||||
return false;
|
||||
|
||||
if (m_videoStream >= (int)m_pFormatCtx->nb_streams) {
|
||||
WARN_LOG_REPORT(ME, "Bad video stream %d", m_videoStream);
|
||||
m_videoStream = -1;
|
||||
}
|
||||
|
||||
if (m_videoStream == -1) {
|
||||
// Find the first video stream
|
||||
for(int i = 0; i < (int)m_pFormatCtx->nb_streams; i++) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user