Skip to content
Snippets Groups Projects
Commit 62b266ae authored by Petter Reinholdtsen's avatar Petter Reinholdtsen
Browse files

Made mask unsigned to avoid shifting into sign bit.

The last iteration of the loop execute 1<<63, which would push the
result into the signed bit of a signed 64 bit type, and this
move into currently undefined behaviour with C99.  Avoid the
issue by making the operation work on unsigned 64 bit type instead.

This require libogg version to 1.3.4, raise autotools dependency check
to look for this.

Partly solves github issue #18.
parent 15acdb8e
No related branches found
No related tags found
No related merge requests found
Pipeline #6217 passed
......@@ -392,7 +392,7 @@ dnl check for pkg-config itself so we don't try the m4 macro without pkg-config
AC_CHECK_PROG(HAVE_PKG_CONFIG, pkg-config, yes)
if test "x$HAVE_PKG_CONFIG" = "xyes"
then
PKG_CHECK_MODULES(OGG, ogg >= 1.1, HAVE_OGG=yes, HAVE_OGG=no)
PKG_CHECK_MODULES(OGG, ogg >= 1.3.4, HAVE_OGG=yes, HAVE_OGG=no)
fi
if test "x$HAVE_OGG" = "xno"
then
......@@ -407,7 +407,7 @@ then
CFLAGS="$CFLAGS $OGG_CFLAGS"
LIBS="$LIBS $OGG_LIBS"
AC_CHECK_FUNC(oggpackB_read, , [
AC_MSG_ERROR([newer libogg version (1.1 or later) required])
AC_MSG_ERROR([newer libogg version (1.3.4 or later) required])
])
CFLAGS=$cflags_save
LIBS=$libs_save
......
......@@ -388,7 +388,7 @@ static void oc_state_border_init(oc_theora_state *_state){
/*Otherwise, check to see if it straddles the border.*/
else if(x<crop_x0&&crop_x0<x+8||x<crop_xf&&crop_xf<x+8||
y<crop_y0&&crop_y0<y+8||y<crop_yf&&crop_yf<y+8){
ogg_int64_t mask;
ogg_uint64_t mask;
int npixels;
int i;
mask=npixels=0;
......@@ -396,7 +396,7 @@ static void oc_state_border_init(oc_theora_state *_state){
int j;
for(j=0;j<8;j++){
if(x+j>=crop_x0&&x+j<crop_xf&&y+i>=crop_y0&&y+i<crop_yf){
mask|=(ogg_int64_t)1<<(i<<3|j);
mask|=(ogg_uint64_t)1<<(i<<3|j);
npixels++;
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment