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;
int size= buf_size + avctx->extradata_size;
*poutbuf_size= size;
*poutbuf= av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE);
+ if (!*poutbuf)
+ return AVERROR(ENOMEM);
memcpy(*poutbuf, avctx->extradata, avctx->extradata_size);
memcpy((*poutbuf) + avctx->extradata_size, buf, buf_size + FF_INPUT_BUFFER_PADDING_SIZE);
}
*poutbuf = av_malloc(buf_size + 20 + FF_INPUT_BUFFER_PADDING_SIZE);
+ if (!*poutbuf)
+ return AVERROR(ENOMEM);
poutbufp = *poutbuf;
bytestream_put_buffer(&poutbufp, imx_header, 16);
bytestream_put_byte(&poutbufp, 0x83); /* KLV BER long form */
*poutbuf_size = 0;
*poutbuf = av_malloc(buf_size + 44 + FF_INPUT_BUFFER_PADDING_SIZE);
+ if (!*poutbuf)
+ return AVERROR(ENOMEM);
poutbufp = *poutbuf;
bytestream_put_byte(&poutbufp, 0xff);
bytestream_put_byte(&poutbufp, SOI);
if (buf_size > 0xffff) return 0;
*poutbuf_size = buf_size + 2;
*poutbuf = av_malloc(*poutbuf_size + FF_INPUT_BUFFER_PADDING_SIZE);
+ if (!*poutbuf)
+ return AVERROR(ENOMEM);
AV_WB16(*poutbuf, buf_size);
memcpy(*poutbuf + 2, buf, buf_size);
return 1;
if (buf_size < 2) return 0;
*poutbuf_size = FFMIN(buf_size - 2, AV_RB16(buf));
*poutbuf = av_malloc(*poutbuf_size + FF_INPUT_BUFFER_PADDING_SIZE);
+ if (!*poutbuf)
+ return AVERROR(ENOMEM);
memcpy(*poutbuf, buf + 2, *poutbuf_size);
return 1;
}
int i;
*poutbuf= av_malloc(buf_size + FF_INPUT_BUFFER_PADDING_SIZE);
-
+ if (!*poutbuf)
+ return AVERROR(ENOMEM);
memcpy(*poutbuf, buf, buf_size + FF_INPUT_BUFFER_PADDING_SIZE);
for(i=0; i<buf_size; i++){
(*state) += (*poutbuf)[i] + 1;
*poutbuf_size = size;
*poutbuf = av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE);
+ if (!*poutbuf)
+ return AVERROR(ENOMEM);
memcpy(*poutbuf, avctx->extradata, avctx->extradata_size);
memcpy(*poutbuf + avctx->extradata_size, buf,