Skip to content

Commit

Permalink
[editor] Fix memleak on failure of demuxer to open video or when canc…
Browse files Browse the repository at this point in the history
…elled by user
  • Loading branch information
eumagga0x2a committed Jan 19, 2023
1 parent e56094e commit cf47c31
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions avidemux/common/ADM_editor/src/ADM_edit.cpp
Expand Up @@ -503,17 +503,20 @@ uint8_t ADM_Composer::addFile (const char *name)

// check opening was successful
if (ret == 0) {
char str[512+1];
snprintf(str,512,QT_TRANSLATE_NOOP("ADM_Composer","Attempt to open %s failed!"), name);
str[512] = '\0';
GUI_Error_HIG(str,NULL);
video._aviheader=NULL;
return false;
delete video._aviheader;
video._aviheader = NULL;
char str[512];
snprintf(str,512,QT_TRANSLATE_NOOP("ADM_Composer","Attempt to open %s failed!"), name);
str[511] = '\0';
GUI_Error_HIG(str,NULL);
return false;
}

if(ret==ADM_IGN)
{
ADM_info("Cancelled by user\n");
delete video._aviheader;
video._aviheader = NULL;
return ret;
}

Expand Down

0 comments on commit cf47c31

Please sign in to comment.