}
if (avctx->extradata_size > 0 && avctx->extradata &&
- ff_h264_decode_extradata(h, avctx->extradata, avctx->extradata_size) < 0)
+ ff_h264_decode_extradata(h, avctx->extradata, avctx->extradata_size) < 0) {
+ ff_h264_free_context(h);
return -1;
+ }
if (h->sps.bitstream_restriction_flag &&
s->avctx->has_b_frames < h->sps.num_reorder_frames) {
flush_dpb(s->avctx);
ff_MPV_common_end(s);
h->list_count = 0;
+ h->current_slice = 0;
}
if (!s->context_initialized) {
if (h != h0) {