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

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: 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 6880dc44a1a0c550b7a9241224d61923fc9a562f..d1a0b5daaff78472a26cf93c6a1e659b4218ce96 100644
--- a/webkit/media/crypto/ppapi/ffmpeg_cdm_audio_decoder.cc
+++ b/webkit/media/crypto/ppapi/ffmpeg_cdm_audio_decoder.cc
@@ -332,9 +332,10 @@ base::TimeDelta FFmpegCdmAudioDecoder::GetNextOutputTimestamp() const {
}
void FFmpegCdmAudioDecoder::SerializeInt64(int64 value) {
- const uint8_t* ptr = reinterpret_cast<uint8_t*>(&value);
+ uint8 data[sizeof(value)] = { 0 };
+ memcpy(data, &value, sizeof(value));
Ami GONE FROM CHROMIUM 2012/10/26 21:48:44 You could alternatively extend the vector by sizeo
xhwang 2012/10/26 22:28:13 Done.
serialized_audio_frames_.insert(serialized_audio_frames_.end(),
- ptr, ptr + sizeof(value));
+ data, data + 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