summaryrefslogtreecommitdiff
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
commit64821068ea82916bdc6eef9ea3ab95aeff8d7753 (patch)
tree927175b39ab582b2b3f01ca5af6af95421536739 /dom/media
parent1e50396c1b2969841dd27ecce8117646ef62158d (diff)
downloaduxp-64821068ea82916bdc6eef9ea3ab95aeff8d7753.tar.gz
[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 5c1b6c97b1..aec1e91360 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,