mirror of https://github.com/odrling/Aegisub
Fixed crash on charset detection.
Originally committed to SVN as r1811.
This commit is contained in:
parent
ed29ba8f8b
commit
d50c3575f9
|
@ -69,15 +69,17 @@ wxString CharSetDetect::GetEncoding(wxString filename) {
|
|||
// Grab every result obtained
|
||||
std::list<CharDetResult> results;
|
||||
for (int i=0;i<NUM_OF_CHARSET_PROBERS;i++) {
|
||||
int probes = mCharSetProbers[i]->GetProbeCount();
|
||||
for (int j=0;j<probes;j++) {
|
||||
float conf = mCharSetProbers[i]->GetConfidence(j);
|
||||
if (mCharSetProbers[i]) {
|
||||
int probes = mCharSetProbers[i]->GetProbeCount();
|
||||
for (int j=0;j<probes;j++) {
|
||||
float conf = mCharSetProbers[i]->GetConfidence(j);
|
||||
|
||||
// Only bother with those whose confidence is at least 1%
|
||||
if (conf > 0.01f) {
|
||||
results.push_back(CharDetResult());
|
||||
results.back().name = wxString(mCharSetProbers[i]->GetCharSetName(j),wxConvUTF8);
|
||||
results.back().confidence = mCharSetProbers[i]->GetConfidence(j);
|
||||
// Only bother with those whose confidence is at least 1%
|
||||
if (conf > 0.01f) {
|
||||
results.push_back(CharDetResult());
|
||||
results.back().name = wxString(mCharSetProbers[i]->GetCharSetName(j),wxConvUTF8);
|
||||
results.back().confidence = mCharSetProbers[i]->GetConfidence(j);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue