mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-libstb-hal.git
synced 2025-08-26 23:12:44 +02:00
Revert "Revert "workaround for double malloc if container_ffmpeg_stop is not called after file play to end""
This reverts commit83d9b453fc
. Origin commit data ------------------ Branch: master Commit:8b8b6b74b9
Author: vanhofen <vanhofen@gmx.de> Date: 2019-03-01 (Fri, 01 Mar 2019) ------------------ This commit was generated by Migit
This commit is contained in:
@@ -1533,7 +1533,9 @@ int32_t container_ffmpeg_init_av_context(Context_t *context, char *filename, uin
|
|||||||
0 == strncmp(filename, "file://", 7))
|
0 == strncmp(filename, "file://", 7))
|
||||||
{
|
{
|
||||||
AVIOContext *avio_ctx = NULL;
|
AVIOContext *avio_ctx = NULL;
|
||||||
custom_io_tab[AVIdx] = malloc(sizeof(CustomIOCtx_t));
|
if(custom_io_tab[AVIdx] == NULL)//workaround for double malloc if container_ffmpeg_stop is not called after file play to end
|
||||||
|
custom_io_tab[AVIdx] = malloc(sizeof(CustomIOCtx_t));
|
||||||
|
|
||||||
memset(custom_io_tab[AVIdx], 0x00, sizeof(CustomIOCtx_t));
|
memset(custom_io_tab[AVIdx], 0x00, sizeof(CustomIOCtx_t));
|
||||||
|
|
||||||
custom_io_tab[AVIdx]->szFile = filename;
|
custom_io_tab[AVIdx]->szFile = filename;
|
||||||
@@ -2731,7 +2733,11 @@ static int32_t container_ffmpeg_stop(Context_t *context)
|
|||||||
fclose(io->pFile);
|
fclose(io->pFile);
|
||||||
if (io->pMoovFile)
|
if (io->pMoovFile)
|
||||||
fclose(io->pMoovFile);
|
fclose(io->pMoovFile);
|
||||||
free(custom_io_tab[i]);
|
if(custom_io_tab[i] != NULL)
|
||||||
|
{
|
||||||
|
free(custom_io_tab[i]);
|
||||||
|
custom_io_tab[i] = NULL;
|
||||||
|
}
|
||||||
av_freep(&(avContextTab[i]->pb->buffer));
|
av_freep(&(avContextTab[i]->pb->buffer));
|
||||||
av_freep(&(avContextTab[i]->pb));
|
av_freep(&(avContextTab[i]->pb));
|
||||||
use_custom_io[i] = 0;
|
use_custom_io[i] = 0;
|
||||||
|
Reference in New Issue
Block a user