diff options
| author | Carl Hetherington <cth@carlh.net> | 2017-06-07 21:27:40 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2017-06-07 21:27:40 +0100 |
| commit | 2d9f569c146b391159f362c854457ce1facac1e8 (patch) | |
| tree | a89e9932ed139854210341b13bdd9903cae07981 /src/lib/image.cc | |
| parent | 3458d0ec34f08a8eeef9b158f26a476a18548353 (diff) | |
Fix crash when alpha-blending subtitles onto YUV420 images.
Diffstat (limited to 'src/lib/image.cc')
| -rw-r--r-- | src/lib/image.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/lib/image.cc b/src/lib/image.cc index b82cc6072..03a4d96b4 100644 --- a/src/lib/image.cc +++ b/src/lib/image.cc @@ -1035,3 +1035,13 @@ Image::fade (float f) throw PixelFormatError ("fade()", _pixel_format); } } + +shared_ptr<Image> +Image::ensure_aligned (shared_ptr<Image> image) +{ + if (image->aligned()) { + return image; + } + + return shared_ptr<Image> (new Image (image, true)); +} |
