Commit 91ee9b72 authored by Frank Barchard's avatar Frank Barchard Committed by Commit Bot

Fix missing return in MipsCpuCaps.

Previously if MipsCpuCaps were called with something other than
dspr2 or msa, the file was closed but still used.

This change assumed the function is only called internally twice:
once for msa and once for dspr2.  If msa is not being detected,
the function assumed dspr2 was being tested and returns dspr2 was
true.

BUG=libyuv:687
TEST=try bots

Change-Id: I80b328eb5ffc7baf5f1ee5a79c16d75c45ff26cc
Reviewed-on: https://chromium-review.googlesource.com/447831Reviewed-by: 's avatarFrank Barchard <fbarchard@google.com>
Commit-Queue: Frank Barchard <fbarchard@google.com>
parent fb45d18d
Name: libyuv Name: libyuv
URL: http://code.google.com/p/libyuv/ URL: http://code.google.com/p/libyuv/
Version: 1645 Version: 1646
License: BSD License: BSD
License File: LICENSE License File: LICENSE
......
...@@ -11,6 +11,6 @@ ...@@ -11,6 +11,6 @@
#ifndef INCLUDE_LIBYUV_VERSION_H_ #ifndef INCLUDE_LIBYUV_VERSION_H_
#define INCLUDE_LIBYUV_VERSION_H_ #define INCLUDE_LIBYUV_VERSION_H_
#define LIBYUV_VERSION 1645 #define LIBYUV_VERSION 1646
#endif // INCLUDE_LIBYUV_VERSION_H_ #endif // INCLUDE_LIBYUV_VERSION_H_
...@@ -174,9 +174,7 @@ LIBYUV_API SAFEBUFFERS int MipsCpuCaps(const char* cpuinfo_name, ...@@ -174,9 +174,7 @@ LIBYUV_API SAFEBUFFERS int MipsCpuCaps(const char* cpuinfo_name,
if (strcmp(ase, " msa") == 0) { if (strcmp(ase, " msa") == 0) {
return kCpuHasMSA; return kCpuHasMSA;
} }
if (strcmp(ase, " dspr2") == 0) { return kCpuHasDSPR2;
return kCpuHasDSPR2;
}
} }
while (fgets(cpuinfo_line, sizeof(cpuinfo_line) - 1, f)) { while (fgets(cpuinfo_line, sizeof(cpuinfo_line) - 1, f)) {
if (memcmp(cpuinfo_line, "ASEs implemented", 16) == 0) { if (memcmp(cpuinfo_line, "ASEs implemented", 16) == 0) {
...@@ -186,9 +184,7 @@ LIBYUV_API SAFEBUFFERS int MipsCpuCaps(const char* cpuinfo_name, ...@@ -186,9 +184,7 @@ LIBYUV_API SAFEBUFFERS int MipsCpuCaps(const char* cpuinfo_name,
if (strcmp(ase, " msa") == 0) { if (strcmp(ase, " msa") == 0) {
return kCpuHasMSA; return kCpuHasMSA;
} }
if (strcmp(ase, " dspr2") == 0) { return kCpuHasDSPR2;
return kCpuHasDSPR2;
}
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment