소스 검색

postproc/postprocess: Check for av_mallocz() failure

Fixes CID1271050

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Michael Niedermayer 10 년 전
부모
커밋
ac424b23e4
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  1. 3 0
      libpostproc/postprocess.c

+ 3 - 0
libpostproc/postprocess.c

@@ -917,6 +917,9 @@ pp_context *pp_get_context(int width, int height, int cpuCaps){
     int stride= FFALIGN(width, 16);  //assumed / will realloc if needed
     int stride= FFALIGN(width, 16);  //assumed / will realloc if needed
     int qpStride= (width+15)/16 + 2; //assumed / will realloc if needed
     int qpStride= (width+15)/16 + 2; //assumed / will realloc if needed
 
 
+    if (!c)
+        return NULL;
+
     c->av_class = &av_codec_context_class;
     c->av_class = &av_codec_context_class;
     if(cpuCaps&PP_FORMAT){
     if(cpuCaps&PP_FORMAT){
         c->hChromaSubSample= cpuCaps&0x3;
         c->hChromaSubSample= cpuCaps&0x3;