summaryrefslogtreecommitdiffstats
path: root/dom/media
diff options
context:
space:
mode:
authortrav90 <travawine@protonmail.ch>2018-04-26 16:51:50 -0500
committertrav90 <travawine@protonmail.ch>2018-04-26 16:51:50 -0500
commitf4906f9a851c7056fe04d143f4aea2300cd9ba24 (patch)
tree927175b39ab582b2b3f01ca5af6af95421536739 /dom/media
parentccdde52530d10077a0a2489e256ff033d656630c (diff)
downloadUXP-f4906f9a851c7056fe04d143f4aea2300cd9ba24.tar
UXP-f4906f9a851c7056fe04d143f4aea2300cd9ba24.tar.gz
UXP-f4906f9a851c7056fe04d143f4aea2300cd9ba24.tar.lz
UXP-f4906f9a851c7056fe04d143f4aea2300cd9ba24.tar.xz
UXP-f4906f9a851c7056fe04d143f4aea2300cd9ba24.zip
[FFmpeg] Work around a bug with corrupted data
According to FFmpeg documentation, the out parameter is "set to size of parsed buffer or zero if not yet finished." however this is only the case if no error occurred; otherwise it is left untouched. We want the invalid content to generate a decoding error, so we set size to inputSize to ensure decoding failed later.
Diffstat (limited to 'dom/media')
-rw-r--r--dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp b/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
index 5c1b6c97b..aec1e9136 100644
--- a/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
+++ b/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
@@ -181,8 +181,8 @@ FFmpegVideoDecoder<LIBAV_VER>::DoDecode(MediaRawData* aSample, bool* aGotFrame)
#endif
)) {
while (inputSize) {
- uint8_t* data;
- int size;
+ uint8_t* data = inputData;
+ int size = inputSize;
int len = mLib->av_parser_parse2(mCodecParser, mCodecContext, &data, &size,
inputData, inputSize,
aSample->mTime, aSample->mTimecode,