Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/LAVFilters.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHendrik Leppkes <h.leppkes@gmail.com>2014-12-13 02:10:06 +0300
committerHendrik Leppkes <h.leppkes@gmail.com>2014-12-13 02:10:58 +0300
commit1c6246f1639d12e5b2b721f335807dade0a4baf3 (patch)
treea28230bc5bcc80ac8b8b49fc68a70dd928fbd7ac /demuxer
parent1d6a043fa4ef36f80f57e10f279c278cbb8bd024 (diff)
Avoid overflow when calculating number of pixels in an image
CID 1041131, 1041132
Diffstat (limited to 'demuxer')
-rw-r--r--demuxer/Demuxers/LAVFDemuxer.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/demuxer/Demuxers/LAVFDemuxer.cpp b/demuxer/Demuxers/LAVFDemuxer.cpp
index e56d4cf1..c4c44aa4 100644
--- a/demuxer/Demuxers/LAVFDemuxer.cpp
+++ b/demuxer/Demuxers/LAVFDemuxer.cpp
@@ -1922,8 +1922,8 @@ const CBaseDemuxer::stream *CLAVFDemuxer::SelectVideoStream()
}
if (!best) { best = check; continue; }
- uint64_t bestPixels = m_avFormat->streams[best->pid]->codec->width * m_avFormat->streams[best->pid]->codec->height;
- uint64_t checkPixels = m_avFormat->streams[check->pid]->codec->width * m_avFormat->streams[check->pid]->codec->height;
+ uint64_t bestPixels = (uint64_t)m_avFormat->streams[best->pid]->codec->width * m_avFormat->streams[best->pid]->codec->height;
+ uint64_t checkPixels = (uint64_t)m_avFormat->streams[check->pid]->codec->width * m_avFormat->streams[check->pid]->codec->height;
if (m_avFormat->streams[best->pid]->codec->codec_id == AV_CODEC_ID_NONE && m_avFormat->streams[check->pid]->codec->codec_id != AV_CODEC_ID_NONE) {
best = check;