[vlc-commits] Use the MKV track width and height when the one in extradata are null

Denis Charmet git at videolan.org
Fri May 9 15:01:51 CEST 2014


vlc | branch: master | Denis Charmet <typx at dinauz.org> | Fri May  9 15:00:27 2014 +0200| [e7eeb9708ffd908b497e7755a3c8cade13aad2b7] | committer: Denis Charmet

Use the MKV track width and height when the one in extradata are null

Fix #11387

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e7eeb9708ffd908b497e7755a3c8cade13aad2b7
---

 modules/demux/mkv/matroska_segment_parse.cpp |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/modules/demux/mkv/matroska_segment_parse.cpp b/modules/demux/mkv/matroska_segment_parse.cpp
index 61e01db..036403b 100644
--- a/modules/demux/mkv/matroska_segment_parse.cpp
+++ b/modules/demux/mkv/matroska_segment_parse.cpp
@@ -1403,8 +1403,13 @@ int32_t matroska_segment_c::TrackInit( mkv_track_t * p_tk )
             MP4_ReadBox_sample_vide( p_mp4_stream, p_box ) )
         {
             p_tk->fmt.i_codec = p_box->i_type;
-            p_tk->fmt.video.i_width = p_box->data.p_sample_vide->i_width;
-            p_tk->fmt.video.i_height = p_box->data.p_sample_vide->i_height;
+            uint32_t i_width = p_box->data.p_sample_vide->i_width;
+            uint32_t i_height = p_box->data.p_sample_vide->i_height;
+            if( i_width && i_height )
+            {
+                p_tk->fmt.video.i_width = i_width;
+                p_tk->fmt.video.i_height = i_height;
+            }
             p_tk->fmt.i_extra = p_box->data.p_sample_vide->i_qt_image_description;
             p_tk->fmt.p_extra = xmalloc( p_tk->fmt.i_extra );
             memcpy( p_tk->fmt.p_extra, p_box->data.p_sample_vide->p_qt_image_description, p_tk->fmt.i_extra );



More information about the vlc-commits mailing list