Browse Source

free subtitle_header before overwriting it to avoid memleak

Originally committed as revision 26176 to svn://svn.ffmpeg.org/ffmpeg/trunk
tags/n0.8
Aurelien Jacobs 15 years ago
parent
commit
f19c58b4cf
1 changed files with 5 additions and 0 deletions
  1. +5
    -0
      libavcodec/utils.c

+ 5
- 0
libavcodec/utils.c View File

@@ -505,6 +505,11 @@ int attribute_align_arg avcodec_open(AVCodecContext *avctx, AVCodec *codec)
avcodec_set_dimensions(avctx, 0, 0);
}

/* if the decoder init function was already called previously,
free the already allocated subtitle_header before overwriting it */
if (codec->decode)
av_freep(&avctx->subtitle_header);

#define SANE_NB_CHANNELS 128U
if (avctx->channels > SANE_NB_CHANNELS) {
ret = AVERROR(EINVAL);


Loading…
Cancel
Save