avcodec: v4l2_m2m: fix races around freeing data on close

Multimedia / FFmpeg - Mark Thompson [jkqxz.net] - 21 January 2018 00:37 EST

Refcount all of the context information. This also fixes a potential segmentation fault when accessing freed memory (buffer returned after the codec has been closed).

a0c624e299 avcodec: v4l2_m2m: fix races around freeing data on close
libavcodec/v4l2_buffers.c | 32 ++++++++++------
libavcodec/v4l2_buffers.h | 6 +++
libavcodec/v4l2_m2m.c | 93 +++++++++++++++++++++++++++++------------------
libavcodec/v4l2_m2m.h | 35 ++++++++++++++----
libavcodec/v4l2_m2m_dec.c | 22 +++++++----
libavcodec/v4l2_m2m_enc.c | 22 +++++++----
6 files changed, 140 insertions(+), 70 deletions(-)

  • Share