~ubuntu-branches/ubuntu/hardy/vlc/hardy

« back to all changes in this revision

Viewing changes to debian/patches/020_flac.diff

  • Committer: Bazaar Package Importer
  • Author(s): Daniel T Chen
  • Date: 2007-06-25 01:53:37 UTC
  • mfrom: (1.1.12 upstream)
  • Revision ID: james.westby@ubuntu.com-20070625015337-9jqzr0atij6hzxnp
Tags: 0.8.6.release.c-0ubuntu1
* SECURITY UPDATE: Format string injection in multiple plugins could
  lead to arbitrary code execution and/or DoS.
* New upstream security and bugfix release, 0.8.6c (LP: #121511).
* References
  CVE-2007-0256
  CVE-2007-3316
* debian/patches/: Remove 020_flac.diff and 030_CVE-2007-0017.diff
  (subsumed by new upstream release).
* debian/vlc-nox.install: Add libtelx_plugin.so (fixes FTBFS).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
Index: /trunk/THANKS
2
 
===================================================================
3
 
--- /trunk/THANKS (revision 18854)
4
 
+++ /trunk/THANKS (revision 18855)
5
 
@@ -25,4 +25,5 @@
6
 
 Arnaud Gomes-do-Vale <arnaud at carrosse.frmug.org> - autoconf patches
7
 
 Arwed v. Merkatz <v.merkatz at gmx dot net> - Gamma correction for adjust filter
8
 
+Ats (through Trac) - libFLAC >= 1.1.3 API support
9
 
 Aurelien - Patch for modules/stream_output/rtp.c proper test for NULL
10
 
 Basil Achermann <vlc at acherma dot com> - Patch to handle esc and space key events from VLCControl (OSX)
11
 
Index: /trunk/modules/codec/flac.c
12
 
===================================================================
13
 
--- /trunk/modules/codec/flac.c (revision 18062)
14
 
+++ /trunk/modules/codec/flac.c (revision 18855)
15
 
@@ -42,4 +42,8 @@
16
 
 #define MAX_FLAC_HEADER_SIZE 16
17
 
 
18
 
+#if defined(FLAC_API_VERSION_CURRENT) && FLAC_API_VERSION_CURRENT >= 8
19
 
+#   define USE_NEW_FLAC_API
20
 
+#endif
21
 
+
22
 
 /*****************************************************************************
23
 
  * decoder_sys_t : FLAC decoder descriptor
24
 
@@ -227,4 +231,23 @@
25
 
     }
26
 
 
27
 
+#ifdef USE_NEW_FLAC_API
28
 
+    if( FLAC__stream_decoder_init_stream( p_sys->p_flac,
29
 
+                                          DecoderReadCallback,
30
 
+                                          NULL,
31
 
+                                          NULL,
32
 
+                                          NULL,
33
 
+                                          NULL,
34
 
+                                          DecoderWriteCallback,
35
 
+                                          DecoderMetadataCallback,
36
 
+                                          DecoderErrorCallback,
37
 
+                                          p_dec )
38
 
+        != FLAC__STREAM_DECODER_INIT_STATUS_OK )
39
 
+    {
40
 
+        msg_Err( p_dec, "FLAC__stream_decoder_init_stream() failed" );
41
 
+        FLAC__stream_decoder_delete( p_sys->p_flac );
42
 
+        free( p_sys );
43
 
+        return VLC_EGENERIC;
44
 
+    }
45
 
+#else
46
 
     FLAC__stream_decoder_set_read_callback( p_sys->p_flac,
47
 
                                             DecoderReadCallback );
48
 
@@ -238,4 +261,5 @@
49
 
 
50
 
     FLAC__stream_decoder_init( p_sys->p_flac );
51
 
+#endif
52
 
 #endif
53
 
 
54
 
@@ -732,14 +756,25 @@
55
 
         msg_Dbg( p_dec, "the decoder has reached the end of the stream." );
56
 
         break;
57
 
+#ifdef USE_NEW_FLAC_API
58
 
+    case FLAC__STREAM_DECODER_OGG_ERROR:
59
 
+        msg_Err( p_dec, "error occurred in the Ogg layer." );
60
 
+        break;
61
 
+    case FLAC__STREAM_DECODER_SEEK_ERROR:
62
 
+        msg_Err( p_dec, "error occurred while seeking." );
63
 
+        break;
64
 
+#endif
65
 
     case FLAC__STREAM_DECODER_ABORTED:
66
 
         msg_Warn( p_dec, "the decoder was aborted by the read callback." );
67
 
         break;
68
 
+#ifndef USE_NEW_FLAC_API
69
 
     case FLAC__STREAM_DECODER_UNPARSEABLE_STREAM:
70
 
         msg_Warn( p_dec, "the decoder encountered reserved fields in use "
71
 
                  "in the stream." );
72
 
         break;
73
 
+#endif
74
 
     case FLAC__STREAM_DECODER_MEMORY_ALLOCATION_ERROR:
75
 
         msg_Err( p_dec, "error when allocating memory." );
76
 
         break;
77
 
+#ifndef USE_NEW_FLAC_API
78
 
     case FLAC__STREAM_DECODER_ALREADY_INITIALIZED:
79
 
         msg_Err( p_dec, "FLAC__stream_decoder_init() was called when the "
80
 
@@ -751,4 +786,5 @@
81
 
                  "all callbacks being set." );
82
 
         break;
83
 
+#endif
84
 
     case FLAC__STREAM_DECODER_UNINITIALIZED:
85
 
         msg_Err( p_dec, "decoder in uninitialized state." );
86
 
@@ -1185,5 +1221,10 @@
87
 
 
88
 
     /* Create flac encoder */
89
 
-    p_sys->p_flac = FLAC__stream_encoder_new();
90
 
+    if( !(p_sys->p_flac = FLAC__stream_encoder_new()) )
91
 
+    {
92
 
+        msg_Err( p_enc, "FLAC__stream_encoder_new() failed" );
93
 
+        free( p_sys );
94
 
+        return VLC_EGENERIC;
95
 
+    }
96
 
 
97
 
     FLAC__stream_encoder_set_streamable_subset( p_sys->p_flac, 1 );
98
 
@@ -1195,4 +1236,22 @@
99
 
     p_enc->fmt_in.i_codec = AOUT_FMT_S16_NE;
100
 
 
101
 
+    /* Get and store the STREAMINFO metadata block as a p_extra */
102
 
+    p_sys->p_chain = 0;
103
 
+
104
 
+#ifdef USE_NEW_FLAC_API
105
 
+    if( FLAC__stream_encoder_init_stream( p_sys->p_flac,
106
 
+                                          EncoderWriteCallback,
107
 
+                                          NULL,
108
 
+                                          NULL,
109
 
+                                          EncoderMetadataCallback,
110
 
+                                          p_enc )
111
 
+        != FLAC__STREAM_ENCODER_INIT_STATUS_OK )
112
 
+    {
113
 
+        msg_Err( p_enc, "FLAC__stream_encoder_init_stream() failed" );
114
 
+        FLAC__stream_encoder_delete( p_sys->p_flac );
115
 
+        free( p_sys );
116
 
+        return VLC_EGENERIC;
117
 
+    }
118
 
+#else
119
 
     FLAC__stream_encoder_set_write_callback( p_sys->p_flac,
120
 
         EncoderWriteCallback );
121
 
@@ -1201,7 +1260,6 @@
122
 
     FLAC__stream_encoder_set_client_data( p_sys->p_flac, p_enc );
123
 
 
124
 
-    /* Get and store the STREAMINFO metadata block as a p_extra */
125
 
-    p_sys->p_chain = 0;
126
 
     FLAC__stream_encoder_init( p_sys->p_flac );
127
 
+#endif
128
 
 
129
 
     return VLC_SUCCESS;
130