| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "media/filters/jpeg_parser.h" | 5 #include "media/filters/jpeg_parser.h" |
| 6 | 6 |
| 7 #include "base/big_endian.h" | 7 #include "base/big_endian.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/macros.h" |
| 9 | 10 |
| 10 using base::BigEndianReader; | 11 using base::BigEndianReader; |
| 11 | 12 |
| 12 #define READ_U8_OR_RETURN_FALSE(out) \ | 13 #define READ_U8_OR_RETURN_FALSE(out) \ |
| 13 do { \ | 14 do { \ |
| 14 uint8_t _out; \ | 15 uint8_t _out; \ |
| 15 if (!reader.ReadU8(&_out)) { \ | 16 if (!reader.ReadU8(&_out)) { \ |
| 16 DVLOG(1) \ | 17 DVLOG(1) \ |
| 17 << "Error in stream: unexpected EOS while trying to read " #out; \ | 18 << "Error in stream: unexpected EOS while trying to read " #out; \ |
| 18 return false; \ | 19 return false; \ |
| (...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 472 DLOG(ERROR) << "SearchEOI failed"; | 473 DLOG(ERROR) << "SearchEOI failed"; |
| 473 return false; | 474 return false; |
| 474 } | 475 } |
| 475 DCHECK(eoi_ptr); | 476 DCHECK(eoi_ptr); |
| 476 result->data_size = eoi_ptr - result->data; | 477 result->data_size = eoi_ptr - result->data; |
| 477 result->image_size = eoi_ptr - reinterpret_cast<const char*>(buffer); | 478 result->image_size = eoi_ptr - reinterpret_cast<const char*>(buffer); |
| 478 return true; | 479 return true; |
| 479 } | 480 } |
| 480 | 481 |
| 481 } // namespace media | 482 } // namespace media |
| OLD | NEW |