diff --git a/libavcodec/parser.c b/libavcodec/parser.c index b5c34dfb76..c1c8ce22ca 100644 --- a/libavcodec/parser.c +++ b/libavcodec/parser.c @@ -58,12 +58,10 @@ AVCodecParserContext *av_parser_init(int codec_id) if (!s) return NULL; s->parser = parser; - if (parser->priv_data_size) { - s->priv_data = av_mallocz(parser->priv_data_size); - if (!s->priv_data) { - av_free(s); - return NULL; - } + s->priv_data = av_mallocz(parser->priv_data_size); + if (!s->priv_data) { + av_free(s); + return NULL; } if (parser->parser_init) { ret = parser->parser_init(s);