af_channelmap: free old extended_data on reallocation

Prevents writes to freed memory and the leak of the old extended data.
Fixes CID732303.
This commit is contained in:
Janne Grunau 2012-10-09 15:41:24 +02:00
parent 18ff4d2020
commit 1afd7a118f

View File

@ -338,8 +338,8 @@ static int channelmap_filter_samples(AVFilterLink *inlink, AVFilterBufferRef *bu
if (buf->extended_data == buf->data) {
buf->extended_data = new_extended_data;
} else {
buf->extended_data = new_extended_data;
av_free(buf->extended_data);
buf->extended_data = new_extended_data;
}
} else if (buf->extended_data != buf->data) {
av_free(buf->extended_data);