]> git.sesse.net Git - ffmpeg/commit
avformat/dss: Don't prematurely modify context variable
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>
Thu, 1 Apr 2021 20:07:40 +0000 (22:07 +0200)
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>
Fri, 2 Apr 2021 13:36:32 +0000 (15:36 +0200)
commitafa511ad34452b1806a6cfa2dd785168140843e6
treee84d1f0df894002e31ff89c2d1fff5f0f9cfd17b
parent543e4a194252050cf1abcded7c75e4b889e3db4f
avformat/dss: Don't prematurely modify context variable

The DSS demuxer currently decrements a counter that should be positive
at the beginning of read_packet; should it become negative, it means
that the data to be read can't be read contiguosly, but has to be read
in two parts. In this case the counter is incremented again after the
first read if said read succeeded; if not, the counter stays negative.

This can lead to problems in further read_packet calls; in tickets #9020
and #9023 it led to segfaults if one tries to seek lateron if the seek
failed and generic seek tried to read from the beginning. But it could
also happen when av_new_packet() failed and the user attempted to read
again afterwards.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
libavformat/dss.c