mpegvideo: release frame buffers before freeing them

Fixes triggering an assert in avcodec_default_release_buffer()
introduced in 1b3439b30.
This commit is contained in:
Janne Grunau 2012-09-19 19:39:52 +02:00
parent ac3a9b51f7
commit 32c7589bb7

View File

@ -1104,14 +1104,15 @@ void ff_MPV_common_end(MpegEncContext *s)
av_freep(&s->reordered_input_picture); av_freep(&s->reordered_input_picture);
av_freep(&s->dct_offset); av_freep(&s->dct_offset);
free_context_frame(s);
if (s->picture && !s->avctx->internal->is_copy) { if (s->picture && !s->avctx->internal->is_copy) {
for (i = 0; i < s->picture_count; i++) { for (i = 0; i < s->picture_count; i++) {
free_picture(s, &s->picture[i]); free_picture(s, &s->picture[i]);
} }
} }
av_freep(&s->picture); av_freep(&s->picture);
free_context_frame(s);
s->context_initialized = 0; s->context_initialized = 0;
s->last_picture_ptr = s->last_picture_ptr =
s->next_picture_ptr = s->next_picture_ptr =