Ticket #469: h264.c.patch

File h264.c.patch, 685 bytes (added by codon1@…, 20 years ago)

New patch to also also free codec extradata

  • h264.c

    old new  
    84808480    return 0;
    84818481}
    84828482
     8483static void h264_parse_close(AVCodecParserContext *s)
     8484{
     8485    H264Context *h = s->priv_data;
     8486    ParseContext *pc = &h->s.parse_context;
     8487    AVCodecContext *avctx = h->s.avctx;
     8488
     8489    if(avctx && avctx->extradata_size && avctx->extradata) {
     8490        av_freep(&avctx->extradata);
     8491        avctx->extradata_size = 0;
     8492    }
     8493
     8494    av_free(pc->buffer);
     8495}
    84838496
    84848497AVCodec h264_decoder = {
    84858498    "h264",
     
    84998512    sizeof(H264Context),
    85008513    NULL,
    85018514    h264_parse,
    8502     ff_parse_close,
     8515    h264_parse_close,
    85038516    h264_split,
    85048517};
    85058518