1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00
FFmpeg/tests/ref
Andreas Rheinhardt 98aaaf08b3 avcodec/rl2: Remove wrong check
This check is intended to be avoid buffer overflows,
yet there are four problems with it:
1. It has an in-built off-by-one error: len == out_end - out
is perfectly fine and nothing to worry about.
This off-by-one error led to the pixel in the lower-right corner
not being set properly for the back frame of the sample from
the rl2 FATE-test. This pixel is copied to every frame which
is the reason for the update to the reference file of said test.
With this patch, the output of the decoder matches the output
as captured from the reference decoder* (apart from the fact
that said reference somehow lacks the top part of the frame
(copied over from the background frame)).
2. Given that the stride of the buffer may be different
from the width of the video (despite one pixel taking one byte),
there is a second check lateron making the first check redundant
(if one returns immediately; a simple break at the second check
is not sufficient, because it only exits the inner loop).
3. The check is based around the assumption of the stride being
positive (it has this in common with the other check which
will be fixed in a future commit).
4. Even after fixing the off-by-one error, the check in
question is still triggered by all the non-background frames
in the FATE sample as well as by A1100100.RL2. In all these
cases, they use len == 255 and val == 128. For videos with
background frame this just means "copy from the background
frame", which would be done anyway lateron.* Yet for videos
without it copying it is necessary to avoid leaving
uninitialized parts in the video.

*: Available in https://samples.mplayerhq.hu/game-formats/voyeur-rl2/
**: Due to this, the code that copies the rest from the
back frame is no longer executed for any of the samples
available on the sample server. Given that these are only
the files from the demo version of this game, I don't know
whether this code is executed for any file in existence or not.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-10-02 20:27:36 +02:00
..
acodec tests/ref: Remove unused reference files 2022-05-03 04:18:06 +02:00
fate avcodec/rl2: Remove wrong check 2022-10-02 20:27:36 +02:00
lavf fate/lavf-audio: Add dfpwm test 2022-09-18 17:48:52 +02:00
lavf-fate avformat/matroskaenc: Don't waste bytes to Write Tag length fields 2022-06-20 23:42:28 +02:00
pixfmt fate/pixfmt: test xyz12le 2021-08-29 18:44:46 +02:00
seek avformat/matroskaenc: Write CodecDelay for codecs != Opus 2022-09-05 20:36:53 +02:00
vsynth avcodec/h263dec: Remove redundant code to set cur_pic_ptr 2022-08-18 16:53:41 +02:00