Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(450)

Unified Diff: media/filters/ffmpeg_video_decoder.cc

Issue 10827149: Check VideoFrame::IsValidConfig() prior to allocating buffers for FFmpeg. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src
Patch Set: Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/ffmpeg_video_decoder.cc
diff --git a/media/filters/ffmpeg_video_decoder.cc b/media/filters/ffmpeg_video_decoder.cc
index c2d34c28d0b77d57d31f5a8121c75ca587c6ef7e..7be2baf2cc937560e90ddf0033acef3604ea8c0a 100644
--- a/media/filters/ffmpeg_video_decoder.cc
+++ b/media/filters/ffmpeg_video_decoder.cc
@@ -81,6 +81,9 @@ int FFmpegVideoDecoder::GetVideoBuffer(AVCodecContext* codec_context,
if ((ret = av_image_check_size(width, height, 0, NULL)) < 0)
return ret;
+ if (!VideoFrame::IsValidConfig(format, width, height))
+ return AVERROR(EINVAL);
+
scoped_refptr<VideoFrame> video_frame =
VideoFrame::CreateFrame(format, width, height, kNoTimestamp());
scherkus (not reviewing) 2012/08/06 20:42:34 this DCHECKs for IsValidConfig() but in release mo
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698