Skip to content

Commit

Permalink
swscale: Check memory allocations
Browse files Browse the repository at this point in the history
CC: libav-stable@libav.org
Bug-Id: CID 1267888 / CID 1267890
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
  • Loading branch information
ftomassetti authored and kodawah committed Feb 17, 2015
1 parent 3035d21 commit e51f221
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions libswscale/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -1382,6 +1382,15 @@ SwsFilter *sws_getDefaultFilter(float lumaGBlur, float chromaGBlur,
filter->chrV = sws_getIdentityVec();
}

if (!filter->lumH || !filter->lumV || !filter->chrH || !filter->chrV) {
sws_freeVec(filter->lumH);
sws_freeVec(filter->lumV);
sws_freeVec(filter->chrH);
sws_freeVec(filter->chrV);
av_freep(&filter);
return NULL;
}

if (chromaSharpen != 0.0) {
SwsVector *id = sws_getIdentityVec();
sws_scaleVec(filter->chrH, -chromaSharpen);
Expand Down

0 comments on commit e51f221

Please sign in to comment.