Skip to content
Snippets Groups Projects
Commit a34aee46 authored by Michael Niedermayer's avatar Michael Niedermayer
Browse files

swr: limit buffer size for silence injection


This reduces memory usage for unreasonable large silence injections

Signed-off-by: default avatarMichael Niedermayer <michaelni@gmx.at>
parent b481d09b
No related branches found
No related tags found
No related merge requests found
......@@ -818,6 +818,13 @@ int swr_inject_silence(struct SwrContext *s, int count){
if(count <= 0)
return 0;
#define MAX_SILENCE_STEP 16384
while (count > MAX_SILENCE_STEP) {
if ((ret = swr_inject_silence(s, MAX_SILENCE_STEP)) < 0)
return ret;
count -= MAX_SILENCE_STEP;
}
if((ret=swri_realloc_audio(&s->silence, count))<0)
return ret;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment