# HG changeset patch # User cehoyos # Date 1283428292 0 # Node ID c64b9d69a1ce2734b6e5afee9e25c076aa175069 # Parent a8abcc0f32cf48ee30fe781f7c83aa7992fc544b Fix crash when decoding DV in AVI introduced in r24579 (issue 2174). Patch by Andrew Wason, rectalogic rectalogic com diff -r a8abcc0f32cf -r c64b9d69a1ce avidec.c --- a/avidec.c Wed Sep 01 22:58:39 2010 +0000 +++ b/avidec.c Thu Sep 02 11:51:32 2010 +0000 @@ -759,7 +759,7 @@ for (i=0; inb_streams; i++) { st = s->streams[i]; ast = st->priv_data; - if (st->discard < AVDISCARD_ALL && ast->sub_pkt.data) { + if (st->discard < AVDISCARD_ALL && ast && ast->sub_pkt.data) { ts = av_rescale_q(ast->sub_pkt.dts, st->time_base, AV_TIME_BASE_Q); if (ts <= next_ts && ts < ts_min) { ts_min = ts; @@ -1294,12 +1294,14 @@ AVStream *st = s->streams[i]; AVIStream *ast = st->priv_data; av_free(st->codec->palctrl); + if (ast) { if (ast->sub_ctx) { av_freep(&ast->sub_ctx->pb); av_close_input_stream(ast->sub_ctx); } av_free(ast->sub_buffer); av_free_packet(&ast->sub_pkt); + } } if (avi->dv_demux)