~ubuntu-branches/ubuntu/vivid/ffmpeg/vivid-security

« back to all changes in this revision

Viewing changes to libavformat/matroskadec.c

  • Committer: Package Import Robot
  • Author(s): Andreas Cadhalpun
  • Date: 2015-07-31 15:50:07 UTC
  • mfrom: (1.2.13)
  • Revision ID: package-import@ubuntu.com-20150731155007-5bvmztbbcs6c5vtw
Tags: 7:2.5.8-0ubuntu0.15.04.1
Import new upstream bugfix release 2.5.8. (LP: #1480311)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1604
1604
        if (!track->codec_id)
1605
1605
            continue;
1606
1606
 
 
1607
        if (track->audio.samplerate < 0 || track->audio.samplerate > INT_MAX ||
 
1608
            isnan(track->audio.samplerate)) {
 
1609
            av_log(matroska->ctx, AV_LOG_WARNING,
 
1610
                   "Invalid sample rate %f, defaulting to 8000 instead.\n",
 
1611
                   track->audio.samplerate);
 
1612
            track->audio.samplerate = 8000;
 
1613
        }
 
1614
 
1607
1615
        if (track->type == MATROSKA_TRACK_TYPE_VIDEO) {
1608
1616
            if (!track->default_duration && track->video.frame_rate > 0)
1609
1617
                track->default_duration = 1000000000 / track->video.frame_rate;
1799
1807
                              NULL, NULL, NULL, NULL);
1800
1808
            avio_write(&b, "TTA1", 4);
1801
1809
            avio_wl16(&b, 1);
 
1810
            if (track->audio.channels > UINT16_MAX ||
 
1811
                track->audio.bitdepth > UINT16_MAX) {
 
1812
                av_log(matroska->ctx, AV_LOG_WARNING,
 
1813
                       "Too large audio channel number %"PRIu64
 
1814
                       " or bitdepth %"PRIu64". Skipping track.\n",
 
1815
                       track->audio.channels, track->audio.bitdepth);
 
1816
                av_freep(&extradata);
 
1817
                if (matroska->ctx->error_recognition & AV_EF_EXPLODE)
 
1818
                    return AVERROR_INVALIDDATA;
 
1819
                else
 
1820
                    continue;
 
1821
            }
1802
1822
            avio_wl16(&b, track->audio.channels);
1803
1823
            avio_wl16(&b, track->audio.bitdepth);
1804
1824
            if (track->audio.out_samplerate < 0 || track->audio.out_samplerate > INT_MAX)