diff options
| author | Carl Hetherington <cth@carlh.net> | 2014-06-02 14:59:10 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2014-06-02 14:59:10 +0100 |
| commit | d5d7d3dbb20deed107f83d58c33bd220e1d47218 (patch) | |
| tree | 3d038ebb05eb35065a95fb24517b6bb56a188b84 /src/lib | |
| parent | 8fb0f4eaa6d91ca9369f45dd7a57c29149edaaac (diff) | |
Expand the over-allocation of image buffers to 32 bytes to attempt to avoid bad reads by swscale.
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/image.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/lib/image.cc b/src/lib/image.cc index 1fa55e242..e8622eba4 100644 --- a/src/lib/image.cc +++ b/src/lib/image.cc @@ -490,8 +490,13 @@ Image::allocate () OS X crashes on this illegal read, though other operating systems don't seem to mind. The nasty + 1 in this malloc makes sure there is always a byte for that instruction to read safely. + + Further to the above, valgrind is now telling me that ff_rgb24ToY_ssse3 + over-reads by more then _avx. I can't follow the code to work out how much, + so I'll just over-allocate by 32 bytes and have done with it. Empirical + testing suggests that it works. */ - _data[i] = (uint8_t *) wrapped_av_malloc (_stride[i] * lines (i) + 1); + _data[i] = (uint8_t *) wrapped_av_malloc (_stride[i] * lines (i) + 32); } } |
