Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
vision
Commits
67f5fcf7
Unverified
Commit
67f5fcf7
authored
Jul 06, 2020
by
Jeff Kriske
Committed by
GitHub
Jul 06, 2020
Browse files
For std::min and std::max cast to like data types (#2389)
Signed-off-by:
Jeff Kriske
<
kriske_jeffery_e@lilly.com
>
parent
75f5b57e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
torchvision/csrc/cpu/decoder/seekable_buffer.cpp
torchvision/csrc/cpu/decoder/seekable_buffer.cpp
+2
-2
torchvision/csrc/cpu/decoder/util.cpp
torchvision/csrc/cpu/decoder/util.cpp
+2
-2
No files found.
torchvision/csrc/cpu/decoder/seekable_buffer.cpp
View file @
67f5fcf7
...
@@ -55,7 +55,7 @@ bool SeekableBuffer::readBytes(
...
@@ -55,7 +55,7 @@ bool SeekableBuffer::readBytes(
size_t
maxBytes
,
size_t
maxBytes
,
uint64_t
timeoutMs
)
{
uint64_t
timeoutMs
)
{
// Resize to th minimum 4K page or less
// Resize to th minimum 4K page or less
buffer_
.
resize
(
std
::
min
(
maxBytes
,
4
*
1024UL
));
buffer_
.
resize
(
std
::
min
(
maxBytes
,
size_t
(
4
*
1024UL
))
)
;
end_
=
0
;
end_
=
0
;
eof_
=
false
;
eof_
=
false
;
...
@@ -72,7 +72,7 @@ bool SeekableBuffer::readBytes(
...
@@ -72,7 +72,7 @@ bool SeekableBuffer::readBytes(
if
(
res
>
0
)
{
if
(
res
>
0
)
{
end_
+=
res
;
end_
+=
res
;
if
(
end_
==
buffer_
.
size
())
{
if
(
end_
==
buffer_
.
size
())
{
buffer_
.
resize
(
std
::
min
(
end_
*
4UL
,
maxBytes
));
buffer_
.
resize
(
std
::
min
(
size_t
(
end_
*
4UL
)
,
maxBytes
));
}
}
}
else
if
(
res
==
0
)
{
}
else
if
(
res
==
0
)
{
eof_
=
true
;
eof_
=
true
;
...
...
torchvision/csrc/cpu/decoder/util.cpp
View file @
67f5fcf7
...
@@ -395,8 +395,8 @@ void setFormatDimensions(
...
@@ -395,8 +395,8 @@ void setFormatDimensions(
}
}
}
}
// prevent zeros
// prevent zeros
destW
=
std
::
max
(
destW
,
1UL
);
destW
=
std
::
max
(
destW
,
size_t
(
1UL
)
)
;
destH
=
std
::
max
(
destH
,
1UL
);
destH
=
std
::
max
(
destH
,
size_t
(
1UL
)
)
;
}
}
}
// namespace Util
}
// namespace Util
}
// namespace ffmpeg
}
// namespace ffmpeg
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment