Memory allocation fix

This commit is contained in:
alex
2019-01-17 19:57:36 +03:00
parent 81e47b9e2b
commit 1e9b5dbc4e

View File

@@ -71,9 +71,8 @@ static char * gmf_get_channel_layout_name(int channels, int layout) {
av_bprint_init(&pbuf, 0, 1);
av_bprint_channel_layout(&pbuf, channels, layout);
char *result = av_malloc(sizeof(char)*1024);
char *result = av_mallocz(pbuf.len);
memset(&result, 0x00, sizeof(result));
memcpy(result, pbuf.str, pbuf.len);
av_bprint_clear(&pbuf);