Ticket #2814: fix2.patch

File fix2.patch, 1.1 KB (added by myth@…, 19 years ago)

another possible (probably better) fix.

  • mythplugins/mythmusic/mythmusic/metaioid3v2.cpp

     
    307307   
    308308    while (loop_de_doo)
    309309    {
     310        const unsigned char *prev_buf;
     311
    310312        if (buflen < sizeof(buffer))
    311313        {
    312314            int bytes;
     
    322324        {
    323325            if (mad_header_decode(&header, &stream) == -1)
    324326            {
     327                // If we fail on the same buffer, we're not going to make
     328                // any progress.
     329                if (prev_buf == stream.buffer)
     330                {
     331                    loop_de_doo = false;
     332                    break;
     333                }
     334                prev_buf = stream.buffer;
     335
    325336                if (!MAD_RECOVERABLE(stream.error))
    326337                {
    327338                    break;
     
    340351            }
    341352            else
    342353            {
     354                prev_buf = 0;
    343355                if(amount_checked == 0)
    344356                {
    345357                    old_bitrate = header.bitrate;