Merge commit '8a9641a652ed1546fedfda22584f79d3d423096e'
authorMichael Niedermayer <michaelni@gmx.at>
Thu, 15 Jan 2015 12:47:12 +0000 (13:47 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Thu, 15 Jan 2015 12:47:12 +0000 (13:47 +0100)
* commit '8a9641a652ed1546fedfda22584f79d3d423096e':
  bsf: check memory allocations

Conflicts:
libavcodec/noise_bsf.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
1  2 
libavcodec/bitstream_filter.c
libavcodec/dump_extradata_bsf.c
libavcodec/imx_dump_header_bsf.c
libavcodec/mjpega_dump_header_bsf.c
libavcodec/movsub_bsf.c
libavcodec/parser.c

@@@ -49,11 -47,20 +49,19 @@@ AVBitStreamFilterContext *av_bitstream_
          if (!strcmp(name, bsf->name)) {
              AVBitStreamFilterContext *bsfc =
                  av_mallocz(sizeof(AVBitStreamFilterContext));
+             if (!bsfc)
+                 return NULL;
              bsfc->filter    = bsf;
-             bsfc->priv_data =
-                 bsf->priv_data_size ? av_mallocz(bsf->priv_data_size) : NULL;
+             bsfc->priv_data = NULL;
+             if (bsf->priv_data_size) {
+                 bsfc->priv_data = av_mallocz(bsf->priv_data_size);
+                 if (!bsfc->priv_data) {
+                     av_freep(&bsfc);
+                     return NULL;
+                 }
+             }
              return bsfc;
          }
 -        bsf = bsf->next;
      }
      return NULL;
  }
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge