--- I left the context extradata unchanged, and I process the new extradata directly. This fixed the crash at decoder_close. Vittorio
libavcodec/h264.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/libavcodec/h264.c b/libavcodec/h264.c index 224ba2f..869b528 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -1042,6 +1042,21 @@ out: return buf_index; } + if (h->is_avc) { + int new_extradata_size = 0; + const uint8_t *new_extradata = av_packet_get_side_data(avpkt, AV_PKT_DATA_NEW_EXTRADATA, &new_extradata_size); + + if (new_extradata_size > 0 && new_extradata) { + ret = ff_h264_decode_extradata(new_extradata, + new_extradata_size, + &h->ps, &h->is_avc, + &h->nal_length_size, + avctx->err_recognition, avctx); + if (ret < 0) + return ret; + } + } + buf_index = decode_nal_units(h, buf, buf_size); if (buf_index < 0) return AVERROR_INVALIDDATA; -- 2.8.3 _______________________________________________ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel