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

Unified Diff: media/muxers/webm_muxer.cc

Issue 2903373004: WebmMuxer: handle zero-sized encoded frame in OnEncodedVideo() (Closed)
Patch Set: Created 3 years, 7 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/muxers/webm_muxer.cc
diff --git a/media/muxers/webm_muxer.cc b/media/muxers/webm_muxer.cc
index dc5e07aa78fef1d673153c1132d279077f7a9a10..92e1e27e97f81f7b106186b7d12c566c6eb4bbae 100644
--- a/media/muxers/webm_muxer.cc
+++ b/media/muxers/webm_muxer.cc
@@ -140,6 +140,12 @@ bool WebmMuxer::OnEncodedVideo(const VideoParameters& params,
DVLOG(1) << __func__ << " - " << encoded_data->size() << "B";
DCHECK(thread_checker_.CalledOnValidThread());
+ if (encoded_data->size() == 0u) {
+ DLOG(WARNING) << __func__ << ": zero size encoded frame, skipping";
+ // Some encoders give sporadic zero-size data, see https://crbug.com/716451.
+ return true;
+ }
+
if (!video_track_index_) {
// |track_index_|, cannot be zero (!), initialize WebmMuxer in that case.
// http://www.matroska.org/technical/specs/index.html#Tracks
« 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