Commit 59092e21 authored by conrad's avatar conrad

bugfix: remove memory leak in oggz_write when closing a stream early (before

writing the next packet, when it has already been dequeued) -- detected by
valgrind on write-suffix test, and similar write-prefix test


git-svn-id: http://svn.annodex.net/liboggz/trunk@2340 8158c8cd-e7e1-0310-9fa4-c5954c97daef
parent 74805cc2
......@@ -163,6 +163,9 @@ oggz_write_close (OGGZ * oggz)
oggz_write_flush (oggz);
oggz_writer_packet_free (writer->current_zpacket);
oggz_writer_packet_free (writer->next_zpacket);
oggz_vector_foreach (writer->packet_queue,
(OggzFunc)oggz_writer_packet_free);
oggz_vector_delete (writer->packet_queue);
......
......@@ -67,7 +67,7 @@ write_bad_granulepos_LDADD = $(OGGZ_LIBS)
write_bad_packetno_SOURCES = write-bad-packetno.c
write_bad_packetno_LDADD = $(OGGZ_LIBS)
write_prefix_SOURCES = write-suffix.c
write_prefix_SOURCES = write-prefix.c
write_prefix_LDADD = $(OGGZ_LIBS)
write_suffix_SOURCES = write-suffix.c
write_suffix_LDADD = $(OGGZ_LIBS)
......
......@@ -55,7 +55,7 @@ hungry (OGGZ * oggz, int empty, void * user_data)
switch (packetno) {
case 0:
INFO ("Feeding stream suffix");
INFO ("Feeding stream prefix");
op.b_o_s = 1;
op.e_o_s = 0;
serialno = serialno1;
......@@ -84,7 +84,7 @@ hungry (OGGZ * oggz, int empty, void * user_data)
err = oggz_write_feed (oggz, &op, serialno, 0, NULL);
if (err != 0) {
printf ("Error %d\n", err);
printf ("Error %ld\n", err);
FAIL ("Could not feed OGGZ");
#if 0
switch (err) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment