[vlc-commits] demux: mkv: use dynamic_cast for downcasting
Zhao Zhili
git at videolan.org
Mon May 28 10:11:54 CEST 2018
vlc | branch: master | Zhao Zhili <quinkblack at foxmail.com> | Mon May 28 15:00:40 2018 +0800| [eda12e94f01709c022309ac94c0b9640c2cbc6a5] | committer: Steve Lhomme
demux: mkv: use dynamic_cast for downcasting
Signed-off-by: Steve Lhomme <robux4 at ycbcr.xyz>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=eda12e94f01709c022309ac94c0b9640c2cbc6a5
---
modules/demux/mkv/Ebml_parser.cpp | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/modules/demux/mkv/Ebml_parser.cpp b/modules/demux/mkv/Ebml_parser.cpp
index 4a9325bf23..76bc45a1ea 100644
--- a/modules/demux/mkv/Ebml_parser.cpp
+++ b/modules/demux/mkv/Ebml_parser.cpp
@@ -209,7 +209,8 @@ next:
if( m_el[mi_level] == NULL )
{
- if ( i_max_read != UINT64_MAX && !static_cast<vlc_stream_io_callback *>(&m_es->I_O())->IsEOF() )
+ vlc_stream_io_callback *io_callback = dynamic_cast<vlc_stream_io_callback *>(&m_es->I_O());
+ if ( i_max_read != UINT64_MAX && io_callback != NULL && !io_callback->IsEOF() )
{
msg_Dbg(p_demux, "found nothing, go up");
i_ulev = 1;
More information about the vlc-commits
mailing list