]> git.ipfire.org Git - thirdparty/asterisk.git/commit
file.c: Prevent formats from seeking negative offsets.
authorNaveen Albert <asterisk@phreaknet.org>
Tue, 1 Mar 2022 01:29:43 +0000 (01:29 +0000)
committerFriendly Automation <jenkins2@gerrit.asterisk.org>
Wed, 27 Apr 2022 00:24:46 +0000 (19:24 -0500)
commitce7846e658f323a31361ca47d8e534b1f16b7173
tree6e5c30bed451b0ea2d283f6a1d3d362603320739
parent193b7a81fe1d3d9830d060688976dc98ff5ab299
file.c: Prevent formats from seeking negative offsets.

Currently, if a user uses an application like ControlPlayback
to try to rewind a file past the beginning, this can throw
warnings when the file format (e.g. PCM) tries to seek to
a negative offset.

Instead of letting file formats try (and fail) to seek a
negative offset, we instead now catch this in the rewind
function to ensure that we never seek an offset less than 0.
This prevents legitimate user actions from triggering warnings
from any particular file formats.

ASTERISK-29943 #close

Change-Id: Ia53f2623f57898f4b8e5c894b968b01e95426967
main/file.c