diff options
author | Chris Koying Browet <cbro@semperpax.com> | 2018-02-28 13:17:28 +0100 |
---|---|---|
committer | Chris Koying Browet <cbro@semperpax.com> | 2018-02-28 17:00:56 +0100 |
commit | baa7abb92056eaf36ebdb0f1e41ebb71b903f94f (patch) | |
tree | 5ddb33cd5be1a1389bfc1e18229906206c211d87 | |
parent | 1ed0d617631f1ee69432802ec7d0d6d9a302d5cb (diff) |
FIX: Don't extract thumbs larger than the source
-rw-r--r-- | xbmc/cores/VideoPlayer/DVDFileInfo.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/xbmc/cores/VideoPlayer/DVDFileInfo.cpp b/xbmc/cores/VideoPlayer/DVDFileInfo.cpp index 1350dcf9c2..3a00bb310a 100644 --- a/xbmc/cores/VideoPlayer/DVDFileInfo.cpp +++ b/xbmc/cores/VideoPlayer/DVDFileInfo.cpp @@ -254,11 +254,11 @@ bool CDVDFileInfo::ExtractThumb(const std::string &strPath, if (iDecoderState == CDVDVideoCodec::VC_PICTURE && !(picture.iFlags & DVP_FLAG_DROPPED)) { { - unsigned int nWidth = g_advancedSettings.m_imageRes; + unsigned int nWidth = std::min(picture.iDisplayWidth, g_advancedSettings.m_imageRes); double aspect = (double)picture.iDisplayWidth / (double)picture.iDisplayHeight; if(hint.forced_aspect && hint.aspect != 0) aspect = hint.aspect; - unsigned int nHeight = (unsigned int)((double)g_advancedSettings.m_imageRes / aspect); + unsigned int nHeight = (unsigned int)((double)nWidth / aspect); uint8_t *pOutBuf = (uint8_t*)av_malloc(nWidth * nHeight * 4); struct SwsContext *context = sws_getContext(picture.iWidth, picture.iHeight, |