Made MainTest#test_open_non_ogg_file pass.
authorTilman Sauerbeck <tilman@code-monkey.de>
Thu, 17 Aug 2006 15:40:31 +0000 (17:40 +0200)
committerTilman Sauerbeck <tilman@code-monkey.de>
Wed, 23 Aug 2006 17:39:15 +0000 (19:39 +0200)
ext/vcedit.c

index 22a8271afabfc84f559eddec87ad1c2042b0b0b1..1aee14c25ed1fcf4cd0b0ba2fb2d53edd903b3fa 100644 (file)
@@ -162,7 +162,9 @@ vcedit_state_unref (vcedit_state *state)
        if (--state->refcount)
                return;
 
-       vcedit_clear_internals (state);
+       if (state->opened)
+               vcedit_clear_internals (state);
+
        vcedit_state_free (state);
 }
 
@@ -301,9 +303,9 @@ vcedit_open (vcedit_state *state)
 
                /* Bail if we don't find data in the first 40 kB */
                if (chunks++ >= 10) {
-                       ret = VCEDIT_ERR_INVAL;
+                       ogg_sync_clear (state->oy);
 
-                       goto err;
+                       return VCEDIT_ERR_INVAL;
                }
        }