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

Unified Diff: media/filters/ffmpeg_demuxer.cc

Issue 4619001: Make sure that ffmpeg returning us an invalid stream cannot damage us too... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years, 1 month 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_demuxer.cc
===================================================================
--- media/filters/ffmpeg_demuxer.cc (revision 65271)
+++ media/filters/ffmpeg_demuxer.cc (working copy)
@@ -529,7 +529,12 @@
// thread.
DCHECK_GE(packet->stream_index, 0);
DCHECK_LT(packet->stream_index, static_cast<int>(packet_streams_.size()));
- FFmpegDemuxerStream* demuxer_stream = packet_streams_[packet->stream_index];
+ FFmpegDemuxerStream* demuxer_stream = NULL;
+ size_t i = packet->stream_index;
fbarchard 2010/11/08 15:55:47 Why create a new variable (i)? FFmpegDemuxerStream
+ // Defend against ffmpeg giving us a bad stream index.
+ if (i < packet_streams_.size()) {
+ demuxer_stream = packet_streams_[i];
+ }
if (demuxer_stream) {
// Queue the packet with the appropriate stream. The stream takes
// ownership of the AVPacket.
« 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