avcodec/h264_slice: Clear table pointers to avoid stale pointers

Might fix Ticket3889

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 547fce9585)

Conflicts:

	libavcodec/h264_slice.c

Conflicts:

	libavcodec/h264.c
This commit is contained in:
Michael Niedermayer 2014-11-02 01:55:40 +01:00
parent d327f673f9
commit 3296e30d37
1 changed files with 13 additions and 0 deletions

View File

@ -1224,6 +1224,19 @@ static int decode_update_thread_context(AVCodecContext *dst, const AVCodecContex
memcpy(&h->s + 1, &h1->s + 1, sizeof(H264Context) - sizeof(MpegEncContext)); //copy all fields after MpegEnc
memset(h->sps_buffers, 0, sizeof(h->sps_buffers));
memset(h->pps_buffers, 0, sizeof(h->pps_buffers));
h->intra4x4_pred_mode= NULL;
h->non_zero_count = NULL;
h->slice_table_base = NULL;
h->slice_table = NULL;
h->cbp_table = NULL;
h->chroma_pred_mode_table = NULL;
memset(h->mvd_table, 0, sizeof(h->mvd_table));
h->direct_table = NULL;
h->list_counts = NULL;
h->mb2b_xy = NULL;
h->mb2br_xy = NULL;
if (ff_h264_alloc_tables(h) < 0) {
av_log(dst, AV_LOG_ERROR, "Could not allocate memory for h264\n");
return AVERROR(ENOMEM);