Verified Commit bb7a7237 authored by Paul Adenot's avatar Paul Adenot Committed by ma1
Browse files

Bug 1536243 - Use av_mallocz to zero FFmpeg extradata padding. r=media-playback-reviewers,jolin

parent d9d20a24
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -62,7 +62,7 @@ MediaResult FFmpegDataDecoder<LIBAV_VER>::AllocateExtraData() {
        FF_INPUT_BUFFER_PADDING_SIZE;
#endif
    mCodecContext->extradata = static_cast<uint8_t*>(
        mLib->av_malloc(mExtraData->Length() + padding_size));
        mLib->av_mallocz(mExtraData->Length() + padding_size));
    if (!mCodecContext->extradata) {
      return MediaResult(NS_ERROR_OUT_OF_MEMORY,
                         RESULT_DETAIL("Couldn't init ffmpeg extradata"));
+1 −0
Original line number Diff line number Diff line
@@ -197,6 +197,7 @@ FFmpegLibWrapper::LinkResult FFmpegLibWrapper::Link() {
  AV_FUNC(avcodec_descriptor_get, AV_FUNC_AVCODEC_ALL)
  AV_FUNC(av_log_set_level, AV_FUNC_AVUTIL_ALL)
  AV_FUNC(av_malloc, AV_FUNC_AVUTIL_ALL)
  AV_FUNC(av_mallocz, AV_FUNC_AVUTIL_ALL)
  AV_FUNC(av_freep, AV_FUNC_AVUTIL_ALL)
  AV_FUNC(av_frame_alloc,
          (AV_FUNC_AVUTIL_55 | AV_FUNC_AVUTIL_56 | AV_FUNC_AVUTIL_57 |
+1 −0
Original line number Diff line number Diff line
@@ -119,6 +119,7 @@ struct MOZ_ONLY_USED_TO_AVOID_STATIC_CONSTRUCTORS FFmpegLibWrapper {
  // libavutil
  void (*av_log_set_level)(int level);
  void* (*av_malloc)(size_t size);
  void* (*av_mallocz)(size_t size);
  void (*av_freep)(void* ptr);
  int (*av_image_check_size)(unsigned int w, unsigned int h, int log_offset,
                             void* log_ctx);
+12 −0
Original line number Diff line number Diff line
<html class="reftest-wait">
<video id='v'>
  <source src='1536243.mp4'>
</video>
<script>
  function done() {
    document.documentElement.removeAttribute("class");
  }
  v.addEventListener('error', done, true);
  v.addEventListener('ended', done, true);
  v.play();
</script>
+2.37 KiB

File added.

No diff preview for this file type.

Loading