projects
/
dcpomatic.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Fix crash when alpha-blending subtitles onto YUV420 images.
[dcpomatic.git]
/
src
/
lib
/
image.cc
diff --git
a/src/lib/image.cc
b/src/lib/image.cc
index b82cc607249965cfbd8753c48e1421440614588b..03a4d96b4848da8a133828c144195b76033d396c 100644
(file)
--- 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));
+}