# HG changeset patch # User reimar # Date 1239373804 0 # Node ID a673af90ed8f0098d055f4cf13f014ede0124326 # Parent 6cd9e789dd9e9b85d3dd8577a2779776bcf46767 Loop up to MAX_THREADS instead of h->s.avctx->thread_count to free the thread contexts, this avoids a crash when freeing the H.264 parser context introduced in r18406, since h->s.avctx is NULL there. diff -r 6cd9e789dd9e -r a673af90ed8f h264.c --- a/h264.c Fri Apr 10 11:33:14 2009 +0000 +++ b/h264.c Fri Apr 10 14:30:04 2009 +0000 @@ -1989,7 +1989,7 @@ av_freep(&h->mb2b_xy); av_freep(&h->mb2b8_xy); - for(i = 0; i < h->s.avctx->thread_count; i++) { + for(i = 0; i < MAX_THREADS; i++) { hx = h->thread_context[i]; if(!hx) continue; av_freep(&hx->top_borders[1]);