[vlc-commits] media_discoverer: fix memory corruption when listing services

Thomas Guillem git at videolan.org
Fri Jun 10 11:58:27 CEST 2016


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Fri Jun 10 11:50:11 2016 +0200| [09f8d87f475fc9fa486b6432c245c46208016c43] | committer: Thomas Guillem

media_discoverer: fix memory corruption when listing services

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

 lib/media_discoverer.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/lib/media_discoverer.c b/lib/media_discoverer.c
index 7b658e3..39ac598 100644
--- a/lib/media_discoverer.c
+++ b/lib/media_discoverer.c
@@ -481,15 +481,14 @@ libvlc_media_discoverer_list_get( libvlc_instance_t *p_inst,
     p_category = p_categories;
     unsigned int i_service_idx = 0;
     libvlc_media_discoverer_description *p_service = p_services;
-    for( ; *ppsz_name != NULL; ppsz_name++, ppsz_longname++, p_category++,
-            p_service++ )
+    for( ; *ppsz_name != NULL; ppsz_name++, ppsz_longname++, p_category++ )
     {
         if( pp_services != NULL && *p_category == i_core_cat )
         {
             p_service->psz_name = *ppsz_name;
             p_service->psz_longname = *ppsz_longname;
             p_service->i_cat = i_cat;
-            pp_services[i_service_idx++] = p_service;
+            pp_services[i_service_idx++] = p_service++;
         }
         else
         {



More information about the vlc-commits mailing list