diff --git a/README.chromium b/README.chromium index 37240a224..a7ababfa3 100644 --- a/README.chromium +++ b/README.chromium @@ -1,6 +1,6 @@ Name: libyuv URL: http://code.google.com/p/libyuv/ -Version: 631 +Version: 632 License: BSD License File: LICENSE diff --git a/include/libyuv/version.h b/include/libyuv/version.h index f360364b8..6724efcbf 100644 --- a/include/libyuv/version.h +++ b/include/libyuv/version.h @@ -11,6 +11,6 @@ #ifndef INCLUDE_LIBYUV_VERSION_H_ // NOLINT #define INCLUDE_LIBYUV_VERSION_H_ -#define LIBYUV_VERSION 631 +#define LIBYUV_VERSION 632 #endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT diff --git a/source/mjpeg_decoder.cc b/source/mjpeg_decoder.cc index 898b441c0..197377760 100644 --- a/source/mjpeg_decoder.cc +++ b/source/mjpeg_decoder.cc @@ -86,10 +86,14 @@ bool ValidateJpeg(const uint8* sample, size_t sample_size) { // ERROR: Invalid jpeg initial start code return false; } - for (int i = static_cast(sample_size) - 1; i > 2; --i) { - if (sample[i - 1] == 0xff && sample[i] == 0xd9) { // End Of Image - return true; + for (int i = static_cast(sample_size) - 2; i > 1;) { + if (sample[i] != 0xd9) { + if (sample[i] == 0xff && sample[i + 1] == 0xd9) { // End Of Image + return true; + } + --i; } + --i; } // ERROR: Invalid jpeg end code not found. Size sample_size return false;