Commit 6ca9901b authored by Jean-Yves Avenard's avatar Jean-Yves Avenard
Browse files

Bug 1261900: [webm] P9. Prevent null deref when webm logs are turned on. r=kinetik

parent b5b89317
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -996,11 +996,13 @@ WebMTrackDemuxer::SkipToNextRandomAccessPoint(media::TimeUnit aTimeThreshold)
  uint32_t parsed = 0;
  bool found = false;
  RefPtr<MediaRawData> sample;
  int64_t sampleTime;

  WEBM_DEBUG("TimeThreshold: %f", aTimeThreshold.ToSeconds());
  while (!found && (sample = NextSample())) {
    parsed++;
    if (sample->mKeyframe && sample->mTime >= aTimeThreshold.ToMicroseconds()) {
    sampleTime = sample->mTime;
    if (sample->mKeyframe && sampleTime >= aTimeThreshold.ToMicroseconds()) {
      found = true;
      mSamples.Reset();
      mSamples.PushFront(sample.forget());
@@ -1009,7 +1011,7 @@ WebMTrackDemuxer::SkipToNextRandomAccessPoint(media::TimeUnit aTimeThreshold)
  SetNextKeyFrameTime();
  if (found) {
    WEBM_DEBUG("next sample: %f (parsed: %d)",
               media::TimeUnit::FromMicroseconds(sample->mTime).ToSeconds(),
               media::TimeUnit::FromMicroseconds(sampleTime).ToSeconds(),
               parsed);
    return SkipAccessPointPromise::CreateAndResolve(parsed, __func__);
  } else {