Displaying 5 results from an estimated 5 matches for "op_granpos_diff".
2017 Nov 20
7
[PATCH 0/2] libopusfile int64 overflows
Just an attempt to avoid overflows with an explicit check, I don't know if
there's a better way to identify corrupt input here.
James Zern (2):
op_pcm_seek: fix int64 overflow
op_fetch_and_process_page: fix int64 overflow
src/opusfile.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
--
2.15.0.448.gf294e3d99a-goog
2017 Dec 07
2
[PATCH 0/2] libopusfile int64 overflows
On Tue, Nov 28, 2017 at 3:22 PM, James Zern <jzern at google.com> wrote:
> On Mon, Nov 20, 2017 at 1:07 PM, James Zern <jzern at google.com> wrote:
>> Just an attempt to avoid overflows with an explicit check, I don't know if
>> there's a better way to identify corrupt input here.
>>
>> James Zern (2):
>> op_pcm_seek: fix int64 overflow
2017 Dec 07
1
[PATCH 0/2] libopusfile int64 overflows
...>
Thanks for recovering them and having a look. I updated both patches.
> For the first patch:
>
>> @@ -2605,7 +2605,11 @@ int op_pcm_seek(OggOpusFile *_of,ogg_int64_t
>> _pcm_offset){
>> would be better just to do a full seek.*/
>> if(OP_LIKELY(!op_granpos_diff(&diff,gp,pcm_start))){
>> ogg_int64_t discard_count;
>> - discard_count=_pcm_offset-diff;
>> + /*Check for overflow.*/
>> + if(diff<0&&OP_UNLIKELY(OP_INT64_MAX+diff<_pcm_offset)){
>> + discard_count=0;
>> +...
2017 Dec 07
0
[PATCH 0/2] libopusfile int64 overflows
...ble with my mail server. I could pull
the patches from the list archive, however. Thanks for the reports.
For the first patch:
> @@ -2605,7 +2605,11 @@ int op_pcm_seek(OggOpusFile *_of,ogg_int64_t _pcm_offset){
> would be better just to do a full seek.*/
> if(OP_LIKELY(!op_granpos_diff(&diff,gp,pcm_start))){
> ogg_int64_t discard_count;
> - discard_count=_pcm_offset-diff;
> + /*Check for overflow.*/
> + if(diff<0&&OP_UNLIKELY(OP_INT64_MAX+diff<_pcm_offset)){
> + discard_count=0;
> + }
> +...
2017 Nov 20
0
[PATCH 1/2] op_pcm_seek: fix int64 overflow
...sertions(+), 1 deletion(-)
diff --git a/src/opusfile.c b/src/opusfile.c
index 72f1272..df326af 100644
--- a/src/opusfile.c
+++ b/src/opusfile.c
@@ -2605,7 +2605,11 @@ int op_pcm_seek(OggOpusFile *_of,ogg_int64_t _pcm_offset){
would be better just to do a full seek.*/
if(OP_LIKELY(!op_granpos_diff(&diff,gp,pcm_start))){
ogg_int64_t discard_count;
- discard_count=_pcm_offset-diff;
+ /*Check for overflow.*/
+ if(diff<0&&OP_UNLIKELY(OP_INT64_MAX+diff<_pcm_offset)){
+ discard_count=0;
+ }
+ else discard_count=_pcm_offset-diff...