mythtranscode does call a function that can return a null pointer and then
From: Erik Hovland <erik@hovland.org>
mythtranscode does not check if that returned pointer is null. This patch
fixes that defect.
---
programs/mythtranscode/mpeg2fix.cpp | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/programs/mythtranscode/mpeg2fix.cpp b/programs/mythtranscode/mpeg2fix.cpp
index 9bf6e02..a6d93ef 100644
a
|
b
|
void MPEG2fixup::WriteFrame(const char *filename, AVPacket *pkt) |
976 | 976 | MPEG2frame *tmpFrame = GetPoolFrame(pkt); |
977 | 977 | if (tmpFrame == NULL) |
978 | 978 | return; |
| 979 | |
979 | 980 | WriteData(filename + QString(".enc"), pkt->data, pkt->size); |
980 | 981 | mpeg2dec_t *tmp_decoder = mpeg2_init(); |
981 | 982 | mpeg2_info_t *info = (mpeg2_info_t *)mpeg2_info(tmp_decoder); |
982 | 983 | |
983 | 984 | while (! info->display_picture) |
984 | | if (ProcessVideo(tmpFrame, tmp_decoder)) |
| 985 | if (ProcessVideo(tmpFrame, tmp_decoder)) { |
| 986 | delete tmpFrame; |
985 | 987 | return; |
| 988 | } |
986 | 989 | |
987 | 990 | WriteYUV(filename, info); |
988 | 991 | framePool.enqueue(tmpFrame); |