doc/examples/resampling_audio: use av_freep() for saftey

also its better in examples to use the safer functions.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
pull/76/merge
Michael Niedermayer 11 years ago
parent d5f817793e
commit cddbf95c5f
  1. 2
      doc/examples/resampling_audio.c

@ -168,7 +168,7 @@ int main(int argc, char **argv)
dst_nb_samples = av_rescale_rnd(swr_get_delay(swr_ctx, src_rate) + dst_nb_samples = av_rescale_rnd(swr_get_delay(swr_ctx, src_rate) +
src_nb_samples, dst_rate, src_rate, AV_ROUND_UP); src_nb_samples, dst_rate, src_rate, AV_ROUND_UP);
if (dst_nb_samples > max_dst_nb_samples) { if (dst_nb_samples > max_dst_nb_samples) {
av_free(dst_data[0]); av_freep(&dst_data[0]);
ret = av_samples_alloc(dst_data, &dst_linesize, dst_nb_channels, ret = av_samples_alloc(dst_data, &dst_linesize, dst_nb_channels,
dst_nb_samples, dst_sample_fmt, 1); dst_nb_samples, dst_sample_fmt, 1);
if (ret < 0) if (ret < 0)

Loading…
Cancel
Save