summaryrefslogtreecommitdiff
path: root/libavcodec/parser.c
diff options
context:
space:
mode:
authorRonald S. Bultje <rbultje@google.com>2011-04-26 18:46:08 -0700
committerMichael Niedermayer <michaelni@gmx.at>2011-04-27 04:20:55 +0200
commit191e08d113ef1d089c45c5fb6c95491e16dde86e (patch)
tree0555070fc04ab952b260a6a0d2f6566d93fc5e34 /libavcodec/parser.c
parent7b9e98173ca7afea8dd76191f63ab6995ba01777 (diff)
avparser: don't av_malloc(0).
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
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 c1c8ce22ca..b5c34dfb76 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);