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
|
b
|
void MPEG2fixup::FrameInfo(MPEG2frame *f) |
623 | 623 | int MPEG2fixup::AddFrame(MPEG2frame *f) |
624 | 624 | { |
625 | 625 | index_unit iu; |
626 | | ringbuffer *rb, *rbi; |
| 626 | ringbuffer *rb = 0, *rbi = 0; |
627 | 627 | int id = f->pkt.stream_index; |
628 | 628 | |
629 | 629 | memset(&iu, 0, sizeof(index_unit)); |
… |
… |
int MPEG2fixup::AddFrame(MPEG2frame *f) |
650 | 650 | iu.framesize = f->pkt.size; |
651 | 651 | } |
652 | 652 | |
| 653 | if (! rb || ! rbi) |
| 654 | { |
| 655 | VERBOSE(MPF_IMPORTANT, "Ringbuffer pointers empty. No stream found\n"); |
| 656 | return 1; |
| 657 | } |
| 658 | |
653 | 659 | iu.active = 1; |
654 | 660 | iu.length = f->pkt.size; |
655 | 661 | iu.pts = f->pkt.pts * 300; |