Browse Source

lavc/options: fix shallow copy context

avcodec_copy_context leaves shallow copy of string/binary/dict options.
Double free/accessing freed memory may occur.

Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
tags/n2.5
Lukasz Marek 11 years ago
parent
commit
db2caf0a80
1 changed files with 1 additions and 0 deletions
  1. +1
    -0
      libavcodec/options.c

+ 1
- 0
libavcodec/options.c View File

@@ -187,6 +187,7 @@ int avcodec_copy_context(AVCodecContext *dest, const AVCodecContext *src)
av_opt_free(dest);

memcpy(dest, src, sizeof(*dest));
av_opt_copy(dest, src);

dest->priv_data = orig_priv_data;



Loading…
Cancel
Save