Chromium Code Reviews| Index: media/filters/ffmpeg_video_decoder.cc |
| diff --git a/media/filters/ffmpeg_video_decoder.cc b/media/filters/ffmpeg_video_decoder.cc |
| index c196590478723611b19ca3c2e3c236352dbd0016..ccc07572848ebf4a2bb0fe1cd8dc2bb30018122b 100644 |
| --- a/media/filters/ffmpeg_video_decoder.cc |
| +++ b/media/filters/ffmpeg_video_decoder.cc |
| @@ -115,12 +115,10 @@ int FFmpegVideoDecoder::GetVideoBuffer(struct AVCodecContext* codec_context, |
| return AVERROR(EINVAL); |
| } |
| + // FFmpeg expects the initialize allocation to be zero-initialized. Failure |
| + // to do so can lead to unitialized value usage. See http://crbug.com/390941 |
| scoped_refptr<VideoFrame> video_frame = frame_pool_.CreateFrame( |
| - format, coded_size, gfx::Rect(size), natural_size, kNoTimestamp()); |
| -#if defined(MEMORY_SANITIZER) |
| - MSAN_UNPOISON(video_frame->data(0), |
| - VideoFrame::AllocationSize(format, coded_size)); |
| -#endif |
| + format, coded_size, gfx::Rect(size), natural_size, kNoTimestamp(), true); |
|
miu
2015/08/04 20:16:22
Instead of adding this extra bool parameter to Vid
miu
2015/08/06 21:23:30
OIC. Hmm...now I'm thinking we ought to just alwa
DaleCurtis
2015/08/07 00:56:02
That's fine with me, in a pool the one-time cost s
|
| // Prefer the color space from the codec context. If it's not specified (or is |
| // set to an unsupported value), fall back on the value from the config. |
| @@ -131,7 +129,7 @@ int FFmpegVideoDecoder::GetVideoBuffer(struct AVCodecContext* codec_context, |
| video_frame->metadata()->SetInteger(VideoFrameMetadata::COLOR_SPACE, |
| color_space); |
| - for (int i = 0; i < 3; i++) { |
| + for (size_t i = 0; i < VideoFrame::NumPlanes(video_frame->format()); i++) { |
| frame->data[i] = video_frame->data(i); |
| frame->linesize[i] = video_frame->stride(i); |
| } |