Check for IO stream failures in various format's truncate/seek operations
authorMatthew Jordan <mjordan@digium.com>
Mon, 16 Apr 2012 20:17:03 +0000 (20:17 +0000)
committerMatthew Jordan <mjordan@digium.com>
Mon, 16 Apr 2012 20:17:03 +0000 (20:17 +0000)
commitba7032be5f4ac8c638806fe6d4f683ec7813c82f
tree4b20c302a1f4d8aed7f6247dacab56281ab2c34a
parentba0f044bde5e5417cec7c3daf2bed907224423e6
Check for IO stream failures in various format's truncate/seek operations

For the formats that support seek and/or truncate operations, many of
the C library calls used to determine or set the current position indicator
in the file stream were not being checked.  In some situations, if an error
occurred, a negative value would be returned from the library call.  This
could then be interpreted inappropriately as positional data.

This patch checks the return values from these library calls before
using them in subsequent operations.

(issue ASTERISK-19655)
Reported by: Matt Jordan

Review: https://reviewboard.asterisk.org/r/1863/
........

Merged revisions 362151 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 362152 from http://svn.asterisk.org/svn/asterisk/branches/10

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@362153 65c4cc65-6c06-0410-ace0-fbb531ad65f3
14 files changed:
formats/format_g719.c
formats/format_g723.c
formats/format_g729.c
formats/format_gsm.c
formats/format_h263.c
formats/format_h264.c
formats/format_ilbc.c
formats/format_pcm.c
formats/format_siren14.c
formats/format_siren7.c
formats/format_sln.c
formats/format_vox.c
formats/format_wav.c
formats/format_wav_gsm.c