diff options
author | trav90 <travawine@protonmail.ch> | 2018-04-26 16:51:50 -0500 |
---|---|---|
committer | trav90 <travawine@protonmail.ch> | 2018-04-26 16:51:50 -0500 |
commit | f4906f9a851c7056fe04d143f4aea2300cd9ba24 (patch) | |
tree | 927175b39ab582b2b3f01ca5af6af95421536739 /dom/media/platforms/ffmpeg | |
parent | ccdde52530d10077a0a2489e256ff033d656630c (diff) | |
download | UXP-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/platforms/ffmpeg')
-rw-r--r-- | dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp | 4 |
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, |