mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-28 16:01:20 +02:00
ffmpegdec fix possible memleak (thx DboxOldie)
This commit is contained in:
@@ -124,12 +124,12 @@ static int64_t seek_packet(void *opaque, int64_t offset, int whence)
|
||||
|
||||
bool CFfmpegDec::Init(void *_in, const CFile::FileType /* ft */)
|
||||
{
|
||||
title = "";
|
||||
artist = "";
|
||||
date = "";
|
||||
album = "";
|
||||
genre = "";
|
||||
type_info = "";
|
||||
title = "";
|
||||
artist = "";
|
||||
date = "";
|
||||
album = "";
|
||||
genre = "";
|
||||
type_info = "";
|
||||
total_time = 0;
|
||||
bitrate = 0;
|
||||
|
||||
@@ -192,8 +192,8 @@ bool CFfmpegDec::Init(void *_in, const CFile::FileType /* ft */)
|
||||
char buf[200]; av_strerror(r, buf, sizeof(buf));
|
||||
fprintf(stderr, "%d %s %d: %s\n", __LINE__, __func__,r,buf);
|
||||
if (avioc)
|
||||
#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(55, 28, 1)
|
||||
av_free(avc->pb);
|
||||
#if (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(57, 83, 100))
|
||||
av_free(avioc);
|
||||
#else
|
||||
avio_context_free(&avioc);
|
||||
#endif
|
||||
@@ -211,7 +211,7 @@ void CFfmpegDec::DeInit(void)
|
||||
{
|
||||
if (avc) {
|
||||
if (avc->pb)
|
||||
#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(55, 28, 1)
|
||||
#if (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(57, 83, 100))
|
||||
av_free(avc->pb);
|
||||
#else
|
||||
avio_context_free(&avc->pb);
|
||||
|
@@ -61,12 +61,12 @@ private:
|
||||
void DeInit(void);
|
||||
void GetMeta(AVDictionary * metadata);
|
||||
|
||||
std::string title;
|
||||
std::string artist;
|
||||
std::string date;
|
||||
std::string album;
|
||||
std::string genre;
|
||||
std::string type_info;
|
||||
std::string title;
|
||||
std::string artist;
|
||||
std::string date;
|
||||
std::string album;
|
||||
std::string genre;
|
||||
std::string type_info;
|
||||
time_t total_time;
|
||||
int bitrate;
|
||||
int samplerate;
|
||||
|
Reference in New Issue
Block a user