History

avparser: don't av_malloc(0).

Ronald S. Bultje committed 15 years ago

Commit 191e08d1 parent 7b9e9811 file · +6 −4Browse files

Unified · Split

libavcodec/parser.c+6−4
@@ -58,10 +58,12 @@ AVCodecParserContext *av_parser_init(int codec_id) · 57 unmodified lines
5858 if (!s)
5959 return NULL;
6060 s->parser = parser;
61− s->priv_data = av_mallocz(parser->priv_data_size);
62− if (!s->priv_data) {
63− av_free(s);
64− return NULL;
61+ if (parser->priv_data_size) {
62+ s->priv_data = av_mallocz(parser->priv_data_size);
63+ if (!s->priv_data) {
64+ av_free(s);
65+ return NULL;
66+ }
6567 }
6668 if (parser->parser_init) {
6769 ret = parser->parser_init(s);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t