diff options
author | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2021-03-12 11:00:32 +0100 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2021-03-23 01:04:09 +0100 |
commit | 2fccd8bfb967276e2b780c446fd7ff9210205cf5 (patch) | |
tree | b719a09531facabb6de264ed0b598fb22cb50452 /fftools | |
parent | 7b100839330ace3b4846ee4a1fc5caf4b8f8a34e (diff) | |
download | ffmpeg-2fccd8bfb967276e2b780c446fd7ff9210205cf5.tar.gz |
avformat/utils: Fix confusing return value for ff_read_packet()
Currently, ff_read_packet() sometimes forwards the return value of
AVInputFormat.read_packet() (which should be zero on success, but isn't
for all demuxers) and sometimes it overwrites this with zero.
Furthermore, it uses two variables, one for the read_packet return value
and one for other errors, which is a bit confusing; it is also
unnecessary given that the documentation explicitly states that
ff_read_packet() never returns positive values. Returning a positive
value would lead to leaks with some callers (namely asfrtp_parse_packet
and estimate_timings_from_pts). So always return zero in case of
success.
(This behaviour stems from a time before av_read_packet sanitized
the return value of read_packet at all: It was added in commit
626004690c23c981f67228ea325dde3f35193988 and was unnecessary since
88b00723906f68b7563214c30333e48888dddf78.)
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Diffstat (limited to 'fftools')
0 files changed, 0 insertions, 0 deletions