cbs_h2645: Remove active ps references when it is replaced
authorMark Thompson <sw@jkqxz.net>
Mon, 11 Dec 2017 00:38:57 +0000 (00:38 +0000)
committerMark Thompson <sw@jkqxz.net>
Tue, 20 Feb 2018 22:04:12 +0000 (22:04 +0000)
libavcodec/cbs_h2645.c

index e3b5bf6..9d05d59 100644 (file)
@@ -674,6 +674,8 @@ static int cbs_h26 ## h26n ## _replace_ ## ps_var(CodedBitstreamContext *ctx, \
                " id : %d.\n", id); \
         return AVERROR_INVALIDDATA; \
     } \
+    if (priv->ps_var[id] == priv->active_ ## ps_var) \
+        priv->active_ ## ps_var = NULL ; \
     av_freep(&priv->ps_var[id]); \
     priv->ps_var[id] = av_malloc(sizeof(*ps_var)); \
     if (!priv->ps_var[id]) \