[vlc-commits] activex: allow empty strings (fixes #14838)

Daniel Amm git at videolan.org
Thu Oct 13 11:15:53 CEST 2016


npapi-vlc | branch: master | Daniel Amm <da2424 at t-online.de> | Tue Oct 11 19:30:59 2016 +0200| [f8e1e6f72e9958f67beb1ca4b02a354434a224b0] | committer: Jean-Baptiste Kempf

activex: allow empty strings (fixes #14838)

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> https://code.videolan.org/videolan/npapi-vlc/commit/f8e1e6f72e9958f67beb1ca4b02a354434a224b0
---

 activex/vlccontrol2.cpp | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/activex/vlccontrol2.cpp b/activex/vlccontrol2.cpp
index 90a8d46..6e50ce2 100644
--- a/activex/vlccontrol2.cpp
+++ b/activex/vlccontrol2.cpp
@@ -1093,8 +1093,11 @@ STDMETHODIMP VLCVideo::get_aspectRatio(BSTR* aspect)
 
 STDMETHODIMP VLCVideo::put_aspectRatio(BSTR aspect)
 {
-    if( NULL == aspect )
-        return E_POINTER;
+    if( 0 == SysStringLen(aspect) )
+    {
+        _plug->get_player().get_mp().setAspectRatio( "" );
+        return S_OK;
+    }
 
     char *psz_aspect = CStrFromBSTR(CP_UTF8, aspect);
     if( !psz_aspect )
@@ -1136,11 +1139,11 @@ STDMETHODIMP VLCVideo::get_crop(BSTR* geometry)
 
 STDMETHODIMP VLCVideo::put_crop(BSTR geometry)
 {
-    if( NULL == geometry )
-        return E_POINTER;
-
     if( 0 == SysStringLen(geometry) )
-        return E_INVALIDARG;
+    {
+        _plug->get_player().get_mp().setCropGeometry( "" );
+        return S_OK;
+    }
 
     char *psz_geometry = CStrFromBSTR(CP_UTF8, geometry);
     if( !psz_geometry )



More information about the vlc-commits mailing list