[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.
This commit is contained in:
trav90 2018-04-26 16:51:50 -05:00 committed by Roy Tam
commit aeea23c315

View file

@ -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,