From: =?utf-8?q?Martin_Stegh=C3=B6fer?= <martin@steghoefer.eu>
Date: Sat, 29 Nov 2014 10:57:11 +0100
Subject: Fix oggenc crash on closing raw input files

Origin: backport, https://trac.xiph.org/changeset/19117/trunk/vorbis-tools/oggenc
Author: Gregory Maxwell <greg@xiph.org>
Bug-Debian: https://bugs.debian.org/771363

Fixes a crash of oggenc on closing of any raw input file. The problem was
a function call using a function pointer that had become invalid when
a variable that was still referenced by a pointer ran out of scope.
---
 oggenc/oggenc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/oggenc/oggenc.c b/oggenc/oggenc.c
index 6a6d8fe..a9d8aa2 100644
--- a/oggenc/oggenc.c
+++ b/oggenc/oggenc.c
@@ -97,6 +97,8 @@ int main(int argc, char **argv)
               .3,-1,
               0,0,0.f,
               0, 0, 0, 0, 0};
+    input_format raw_format = {NULL, 0, raw_open, wav_close, "raw", 
+      N_("RAW file reader")};
 
     int i;
 
@@ -239,8 +241,6 @@ int main(int argc, char **argv)
 
         if(opt.rawmode)
         {
-            input_format raw_format = {NULL, 0, raw_open, wav_close, "raw", 
-                N_("RAW file reader")};
 
             enc_opts.rate=opt.raw_samplerate;
             enc_opts.channels=opt.raw_channels;
