Ticket #5002: libs_libavformat_utils.c-need-to-check-st-codec-again.patch

File libs_libavformat_utils.c-need-to-check-st-codec-again.patch, 993 bytes (added by Erik Hovland <erik@…>, 16 years ago)

adds additional check for st->codec in null check conditional at line 884 in libavformat/utils.c

  • libs/libavformat/utils.c

    A small change was made in the last version that added some checks for
    the internal dvd player. Those checks were good. But one more check
    for st->codec before dereferencing is still needed.
    
    From: Erik Hovland <erik@hovland.org>
    
    ---
    
     libs/libavformat/utils.c |    2 +-
     1 files changed, 1 insertions(+), 1 deletions(-)
    
    diff --git a/libs/libavformat/utils.c b/libs/libavformat/utils.c
    index 1048f19..94eb28e 100644
    a b static int av_read_frame_internal(AVFormatContext *s, AVPacket *pkt) 
    881881            s->cur_st = st;
    882882            s->cur_ptr = s->cur_pkt.data;
    883883            s->cur_len = s->cur_pkt.size;
    884             if (st && st->need_parsing && !st->parser) {
     884            if (st && st->codec && st->need_parsing && !st->parser) {
    885885                st->parser = av_parser_init(st->codec->codec_id);
    886886                if (!st->parser) {
    887887                    /* no parser available : just output the raw packets */