Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(810)

Issue 1657533005: ubsan overflow fix for multiply by 0x01010101 (Closed)

Created:
4 years, 10 months ago by fbarchard1
Modified:
4 years, 10 months ago
Reviewers:
harryjin
Base URL:
https://chromium.googlesource.com/libyuv/libyuv@master
Target Ref:
refs/heads/master
Project:
libyuv
Visibility:
Public.

Description

ubsan overflow fix for multiply by 0x01010101 This is an UBSan error reported by libjingle [ RUN ] WebRtcVideoFrameTest.ConvertToYUY2BufferStride [000:000] (videoframe.cc:375): Validate frame passed. format: I420 bpp: 12 size: 1280x720 bytes: 1382400 expected: 1382400 sample[0..3]: 73, 73, 73, 73 ../../chromium/src/third_party/libyuv/source/row_gcc.cc:2903:25: runtime error: signed integer overflow: 128 * 16843009 cannot be represented in type 'int' [8/614] WebRtcVideoFrameTest.ConvertToYUY2BufferStride returned/aborted with exit code 1 (32 ms) [9/614] WebRtcVideoFrameTest.ConvertToYUY2BufferInverted (29 ms) Note: Google Test filter = WebRtcVideoFrameTest.ConvertToYUY2BufferInverted The source is uint8 and the multiply is by 0x01010101 to replicate the byte to 4 bytes. Changing the constant to 0x01010101u should avoid overflow. R=harryjin@google.com TBR=harryjin@google.com BUG=libyuv:563 Committed: https://chromium.googlesource.com/libyuv/libyuv/+/9e39c1f27124c0f7c7fb1b88e4012df886e13ca9

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+3 lines, -3 lines) Patch
M README.chromium View 1 chunk +1 line, -1 line 0 comments Download
M include/libyuv/version.h View 1 chunk +1 line, -1 line 0 comments Download
M source/row_gcc.cc View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 4 (1 generated)
fbarchard1
4 years, 10 months ago (2016-02-01 18:57:04 UTC) #1
harryjin
lgtm
4 years, 10 months ago (2016-02-01 19:02:29 UTC) #2
fbarchard1
4 years, 10 months ago (2016-02-01 20:29:08 UTC) #4
Message was sent while issue was closed.
Committed patchset #1 (id:1) manually as
9e39c1f27124c0f7c7fb1b88e4012df886e13ca9 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698