The pointers rb and rbi are not initialized at the beginning and could

From: Erik Hovland <erik@hovland.org>

potentially be passed as null to callers of MPEG2fixup::AddFrame.
---

 programs/mythtranscode/mpeg2fix.cpp |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/programs/mythtranscode/mpeg2fix.cpp b/programs/mythtranscode/mpeg2fix.cpp
index 7278883..9bf6e02 100644
--- a/programs/mythtranscode/mpeg2fix.cpp
+++ b/programs/mythtranscode/mpeg2fix.cpp
@@ -623,7 +623,7 @@ void MPEG2fixup::FrameInfo(MPEG2frame *f)
 int MPEG2fixup::AddFrame(MPEG2frame *f)
 {
     index_unit iu;
-    ringbuffer *rb, *rbi;
+    ringbuffer *rb = 0, *rbi = 0;
     int id = f->pkt.stream_index;
 
     memset(&iu, 0, sizeof(index_unit));
@@ -650,6 +650,12 @@ int MPEG2fixup::AddFrame(MPEG2frame *f)
         iu.framesize = f->pkt.size;
     }
 
+    if (! rb || ! rbi)
+    {
+        VERBOSE(MPF_IMPORTANT, "Ringbuffer pointers empty. No stream found\n");
+        return 1;
+    }
+
     iu.active = 1;
     iu.length = f->pkt.size;
     iu.pts = f->pkt.pts * 300;
