Ticket #5080: libs_libmythtv_avformatdecoder.cpp-resolve-ringBuffer-null-check-in-ScanStreams.patch

File libs_libmythtv_avformatdecoder.cpp-resolve-ringBuffer-null-check-in-ScanStreams.patch, 1.6 KB (added by Erik Hovland <erik@…>, 13 years ago)

additional checks for null of ringbuffer in ScanStreams?

  • libs/libmythtv/avformatdecoder.cpp

    There is a check for null of ringBuffer in ScanStreams, and then ringBuffer is
    
    From: Erik Hovland <erik@hovland.org>
    
    dereferenced in the very next piece of code, without being checked.
    ---
    
     libs/libmythtv/avformatdecoder.cpp |    6 +++---
     1 files changed, 3 insertions(+), 3 deletions(-)
    
    diff --git a/libs/libmythtv/avformatdecoder.cpp b/libs/libmythtv/avformatdecoder.cpp
    index 3247e55..00b0eb4 100644
    a b int AvFormatDecoder::ScanStreams(bool novideo) 
    15151515                    // HACK -- end
    15161516
    15171517                    bool force_xv = false;
    1518                     if (ringBuffer->isDVD())
     1518                    if (ringBuffer && ringBuffer->isDVD())
    15191519                    {
    15201520                        if (dec.left(4) == "xvmc")
    15211521                            dvd_xvmc_enabled = true;
    int AvFormatDecoder::ScanStreams(bool novideo) 
    15401540                    enc->codec_id = (CodecID)
    15411541                        myth2av_codecid(mcid, vcd, idct, mc);
    15421542
    1543                     if (ringBuffer->isDVD() && (mcid == video_codec_id) &&
     1543                    if (ringBuffer && ringBuffer->isDVD() && (mcid == video_codec_id) &&
    15441544                        dvd_video_codec_changed)
    15451545                    {
    15461546                        dvd_video_codec_changed = false;
    int AvFormatDecoder::ScanStreams(bool novideo) 
    18021802            ringBuffer->UpdateRawBitrate(bitrate);
    18031803    }
    18041804
    1805     if (ringBuffer->isDVD())
     1805    if (ringBuffer && ringBuffer->isDVD())
    18061806    {
    18071807        if (tracks[kTrackTypeAudio].size() > 1)
    18081808        {