[vlc-commits] fix incorrect return values for spu and audio track descriptions

Felix Paul Kühne git at videolan.org
Mon Apr 28 19:58:10 CEST 2014


npapi-vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Mon Apr 28 19:58:02 2014 +0200| [402dd5a65da82466e5b5897184993cbca1bf91d4] | committer: Felix Paul Kühne

fix incorrect return values for spu and audio track descriptions

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

 npapi/npruntime/npolibvlc.cpp |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/npapi/npruntime/npolibvlc.cpp b/npapi/npruntime/npolibvlc.cpp
index 9936834..8f09283 100644
--- a/npapi/npruntime/npolibvlc.cpp
+++ b/npapi/npruntime/npolibvlc.cpp
@@ -445,9 +445,9 @@ LibvlcAudioNPObject::invoke(int index, const NPVariant *args,
                 return INVOKERESULT_NO_SUCH_METHOD;
             case ID_audio_description:
             {
-                if( argCount == 1)
+                if( argCount == 1 && isNumberValue(args[0]))
                 {
-                    int fakeTrackIndex = isNumberValue(args[0]);
+                    int fakeTrackIndex = numberValue(args[0]);
                     char *psz_name;
 
                     /* bounds checking */
@@ -1419,9 +1419,9 @@ LibvlcSubtitleNPObject::invoke(int index, const NPVariant *args,
         {
             case ID_subtitle_description:
             {
-                if (argCount == 1)
+                if (argCount == 1 && isNumberValue(args[0]))
                 {
-                    int fakeTrackIndex = isNumberValue(args[0]);
+                    int fakeTrackIndex = numberValue(args[0]);
                     char *psz_name;
 
                     /* bounds checking */



More information about the vlc-commits mailing list