[vlc-commits] aout: fix infinite loop on error (fixes #7711)

Rémi Denis-Courmont git at videolan.org
Tue Nov 13 21:49:54 CET 2012


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Tue Nov 13 22:48:53 2012 +0200| [59253bafcf76cfd8c672fbcf5f195b00ff3c9a50] | committer: Rémi Denis-Courmont

aout: fix infinite loop on error (fixes #7711)

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

 src/audio_output/dec.c |    8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/src/audio_output/dec.c b/src/audio_output/dec.c
index 8d72e27..348bc43 100644
--- a/src/audio_output/dec.c
+++ b/src/audio_output/dec.c
@@ -67,7 +67,6 @@ int aout_DecNew( audio_output_t *p_aout,
     }
 
     aout_owner_t *owner = aout_owner(p_aout);
-    int ret = 0;
 
     /* TODO: reduce lock scope depending on decoder's real need */
     aout_lock( p_aout );
@@ -92,8 +91,8 @@ int aout_DecNew( audio_output_t *p_aout,
         aout_OutputDelete (p_aout);
 error:
         aout_volume_Delete (owner->volume);
-        ret = -1;
-        goto error;
+        aout_unlock (p_aout);
+        return -1;
     }
 
     owner->sync.end = VLC_TS_INVALID;
@@ -102,8 +101,7 @@ error:
     aout_unlock( p_aout );
 
     atomic_init (&owner->buffers_lost, 0);
-
-    return ret;
+    return 0;
 }
 
 /**



More information about the vlc-commits mailing list