Skip to content

Commit

Permalink
[editor] Reject video with width or height exceeding maximum supported
Browse files Browse the repository at this point in the history
  • Loading branch information
eumagga0x2a committed Aug 17, 2020
1 parent 29ca290 commit 2403e92
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions avidemux/common/ADM_editor/src/ADM_edit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,29 @@ uint8_t ADM_Composer::addFile (const char *name)
}
// else update info
video._aviheader->getVideoInfo (&info);
if(info.width > MAXIMUM_SIZE || info.height > MAXIMUM_SIZE)
{
char str[512];
str[0] = '\0';
if(info.width > MAXIMUM_SIZE && info.height <= MAXIMUM_SIZE)
{
snprintf(str,512,QT_TRANSLATE_NOOP("ADM_Composer","The width of the video %u px exceeds maximum supported width %u.\n"),
info.width,MAXIMUM_SIZE);
}else if(info.width <= MAXIMUM_SIZE && info.height > MAXIMUM_SIZE)
{
snprintf(str,512,QT_TRANSLATE_NOOP("ADM_Composer","The height of the video %u px exceeds maximum supported height %u.\n"),
info.height,MAXIMUM_SIZE);
}else // both
{
snprintf(str,512,QT_TRANSLATE_NOOP("ADM_Composer","Video dimensions %ux%u exceed maximum supported size %ux%u.\n"),
info.width,info.height,MAXIMUM_SIZE,MAXIMUM_SIZE);
}
str[511] = '\0';
GUI_Error_HIG(QT_TRANSLATE_NOOP("ADM_Composer","Unsupported size"),str);
delete video._aviheader;
video._aviheader=NULL;
return 0;
}
video._aviheader->setMyName (name);

// Printf some info about extradata
Expand Down

0 comments on commit 2403e92

Please sign in to comment.