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

Unified Diff: webkit/media/crypto/ppapi/ffmpeg_cdm_audio_decoder.cc

Issue 11304010: Fix type punning error in (de)serializing audio frames. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase only Created 8 years, 2 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 | « webkit/media/crypto/ppapi/clear_key_cdm.cc ('k') | webkit/plugins/ppapi/ppapi_plugin_instance.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/media/crypto/ppapi/ffmpeg_cdm_audio_decoder.cc
diff --git a/webkit/media/crypto/ppapi/ffmpeg_cdm_audio_decoder.cc b/webkit/media/crypto/ppapi/ffmpeg_cdm_audio_decoder.cc
index a9d892310a237192d7045d438dff502d11df46df..e6f0d2d866735c1a209920af9adc36a3dd6c664b 100644
--- a/webkit/media/crypto/ppapi/ffmpeg_cdm_audio_decoder.cc
+++ b/webkit/media/crypto/ppapi/ffmpeg_cdm_audio_decoder.cc
@@ -333,9 +333,9 @@ base::TimeDelta FFmpegCdmAudioDecoder::GetNextOutputTimestamp() const {
}
void FFmpegCdmAudioDecoder::SerializeInt64(int64 value) {
- const uint8_t* ptr = reinterpret_cast<uint8_t*>(&value);
- serialized_audio_frames_.insert(serialized_audio_frames_.end(),
- ptr, ptr + sizeof(value));
+ int previous_size = serialized_audio_frames_.size();
+ serialized_audio_frames_.resize(previous_size + sizeof(value));
+ memcpy(&serialized_audio_frames_[0] + previous_size, &value, sizeof(value));
}
} // namespace webkit_media
« no previous file with comments | « webkit/media/crypto/ppapi/clear_key_cdm.cc ('k') | webkit/plugins/ppapi/ppapi_plugin_instance.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698