Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRonald S. Bultje <rbultje@google.com>2011-04-27 05:46:08 +0400
committerRonald S. Bultje <rsbultje@gmail.com>2011-04-27 09:07:17 +0400
commit5eef4afb9a5c637229469036285fa9a334f6f7d4 (patch)
tree173834d5c5685b73a4b939bc83f4bd2152bfa172 /libavcodec/parser.c
parent79ee8977c25eee2408ef7b2822f377a983e4d65b (diff)
avparser: don't av_malloc(0).
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
Diffstat (limited to 'libavcodec/parser.c')
-rw-r--r--libavcodec/parser.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/libavcodec/parser.c b/libavcodec/parser.c
index d5b85c3e4e..4b3d30e51a 100644
--- a/libavcodec/parser.c
+++ b/libavcodec/parser.c
@@ -58,10 +58,12 @@ AVCodecParserContext *av_parser_init(int codec_id)
if (!s)
return NULL;
s->parser = parser;
- s->priv_data = av_mallocz(parser->priv_data_size);
- if (!s->priv_data) {
- av_free(s);
- return NULL;
+ if (parser->priv_data_size) {
+ 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);