Skip to content

Commit

Permalink
Merge branch 'Cog' of http://github.com/OpenSmalltalk/vm into Cog
Browse files Browse the repository at this point in the history
  • Loading branch information
eliotmiranda committed Mar 2, 2017
2 parents e818693 + 69a910c commit 7e72650
Show file tree
Hide file tree
Showing 9 changed files with 491 additions and 20 deletions.
4 changes: 2 additions & 2 deletions platforms/Cross/plugins/JPEGReadWriter2Plugin/Error.c
Expand Up @@ -5,7 +5,7 @@
struct error_mgr2 {
struct jpeg_error_mgr pub; /* "public" fields */

jmp_buf setjmp_buffer; /* for return to caller */
jmp_buf *setjmp_buffer; /* for return to caller */
};

typedef struct error_mgr2 * error_ptr2;
Expand All @@ -20,5 +20,5 @@ void error_exit (j_common_ptr cinfo)
error_ptr2 myerr = (error_ptr2) cinfo->err;

/* Return control to the setjmp point */
longjmp(myerr->setjmp_buffer, 1);
longjmp(*myerr->setjmp_buffer, 1);
}
Expand Up @@ -6,7 +6,7 @@
struct error_mgr2 {
struct jpeg_error_mgr pub; /* "public" fields */

jmp_buf setjmp_buffer; /* for return to caller */
jmp_buf *setjmp_buffer; /* for return to caller */
};

typedef struct error_mgr2* error_ptr2;
Expand Down
385 changes: 385 additions & 0 deletions platforms/Cross/plugins/JPEGReadWriter2Plugin/README

Large diffs are not rendered by default.

42 changes: 42 additions & 0 deletions platforms/Cross/plugins/JPEGReadWriter2Plugin/README.6b2
@@ -0,0 +1,42 @@
Extra README for release 6b2 of 25-Dec-2013
===========================================

This release is identical to release 6b1 with the exception of a fix for
CVE 2013-6629 and 2013-6630 (information disclosure).

This release was prepared by Bill Allombert <ballombe@debian.org> by combining
release 6b1 with a fix written by Guido Vollbeding for release 9a.

Files changed:
jdmarker.c
README.6b2 (this file, was README.6b1)

Extra README for release 6b1 of 1-Jun-2010
==========================================

This release is identical to release 6b with the exception of the build system,
and of library symbols versioning on platforms that support them. This release
is only intended as a transition help toward the upgrade to libjpeg8. If you
can upgrade directly to libjpeg8, you do not need libjpeg6b1.

This release was prepared by Bill Allombert <ballombe@debian.org> from release
6b and the build system of release 8 by Guido Vollbeding and Bob Friesenhahn.

Files changed:
config.guess (updated from automake)
config.sub (updated from automake)
configure (autogenerated)
ltmain.sh (updated from libtool)

Files added:
aclocal.m4 (from libjpeg8)
configure.ac (from libjpeg8)
depcomp (from automake)
libjpeg.map (from libjpeg8, modified)
Makefile.am (from libjpeg8, modified)
Makefile.in (autogenerated)
missing (from automake)
README.6b1 (this file)

File removed:
ltconfig (obsoleted)
59 changes: 47 additions & 12 deletions platforms/Cross/plugins/JPEGReadWriter2Plugin/jdmarker.c
Expand Up @@ -2,6 +2,9 @@
* jdmarker.c
*
* Copyright (C) 1991-1998, Thomas G. Lane.
* Modified 2013 by Bill Allombert for CVE 2013-6629 and 2013-6630
* by applying a fix by Guido Vollbeding.
*
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
Expand Down Expand Up @@ -238,7 +241,7 @@ get_sof (j_decompress_ptr cinfo, boolean is_prog, boolean is_arith)
/* Process a SOFn marker */
{
INT32 length;
int c, ci;
int c, ci, i;
jpeg_component_info * compptr;
INPUT_VARS(cinfo);

Expand Down Expand Up @@ -275,11 +278,27 @@ get_sof (j_decompress_ptr cinfo, boolean is_prog, boolean is_arith)
cinfo->comp_info = (jpeg_component_info *) (*cinfo->mem->alloc_small)
((j_common_ptr) cinfo, JPOOL_IMAGE,
cinfo->num_components * SIZEOF(jpeg_component_info));

for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
ci++, compptr++) {

for (ci = 0; ci < cinfo->num_components; ci++) {
INPUT_BYTE(cinfo, c, return FALSE);
/* Check to see whether component id has already been seen */
/* (in violation of the spec, but unfortunately seen in some */
/* files). If so, create "fake" component id equal to the */
/* max id seen so far + 1. */
for (i = 0, compptr = cinfo->comp_info; i < ci; i++, compptr++) {
if (c == compptr->component_id) {
compptr = cinfo->comp_info;
c = compptr->component_id;
compptr++;
for (i = 1; i < ci; i++, compptr++) {
if (compptr->component_id > c) c = compptr->component_id;
}
c++;
break;
}
}
compptr->component_id = c;
compptr->component_index = ci;
INPUT_BYTE(cinfo, compptr->component_id, return FALSE);
INPUT_BYTE(cinfo, c, return FALSE);
compptr->h_samp_factor = (c >> 4) & 15;
compptr->v_samp_factor = (c ) & 15;
Expand All @@ -302,7 +321,7 @@ get_sos (j_decompress_ptr cinfo)
/* Process a SOS marker */
{
INT32 length;
int i, ci, n, c, cc;
int c, ci, i, n;
jpeg_component_info * compptr;
INPUT_VARS(cinfo);

Expand All @@ -323,24 +342,38 @@ get_sos (j_decompress_ptr cinfo)
/* Collect the component-spec parameters */

for (i = 0; i < n; i++) {
INPUT_BYTE(cinfo, cc, return FALSE);
INPUT_BYTE(cinfo, c, return FALSE);


/* Detect the case where component id's are not unique, and, if so, */
/* create a fake component id using the same logic as in get_sof. */
for (ci = 0; ci < i; ci++) {
if (c == cinfo->cur_comp_info[ci]->component_id) {
c = cinfo->cur_comp_info[0]->component_id;
for (ci = 1; ci < i; ci++) {
compptr = cinfo->cur_comp_info[ci];
if (compptr->component_id > c) c = compptr->component_id;
}
c++;
break;
}
}

for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
ci++, compptr++) {
if (cc == compptr->component_id)
if (c == compptr->component_id)
goto id_found;
}

ERREXIT1(cinfo, JERR_BAD_COMPONENT_ID, cc);
ERREXIT1(cinfo, JERR_BAD_COMPONENT_ID, c);

id_found:

cinfo->cur_comp_info[i] = compptr;
INPUT_BYTE(cinfo, c, return FALSE);
compptr->dc_tbl_no = (c >> 4) & 15;
compptr->ac_tbl_no = (c ) & 15;
TRACEMS3(cinfo, 1, JTRC_SOS_COMPONENT, cc,

TRACEMS3(cinfo, 1, JTRC_SOS_COMPONENT, compptr->component_id,
compptr->dc_tbl_no, compptr->ac_tbl_no);
}

Expand Down Expand Up @@ -456,6 +489,8 @@ get_dht (j_decompress_ptr cinfo)
if (count > 256 || ((INT32) count) > length)
ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);

MEMZERO(huffval, SIZEOF(huffval)); /* pre-zero array for later copy */

for (i = 0; i < count; i++)
INPUT_BYTE(cinfo, huffval[i], return FALSE);

Expand Down
Expand Up @@ -54,9 +54,10 @@ primJPEGWriteImageonByteArrayformqualityprogressiveJPEGerrorMgrWriteScanlines(
error_ptr2 pjerr = (error_ptr2)jpegErrorMgr2Struct;

pcinfo->err = jpeg_std_error(&pjerr->pub);
pjerr->setjmp_buffer = (jmp_buf *) malloc(sizeof(jmp_buf));
pjerr->pub.error_exit = error_exit;

if (setjmp(pjerr->setjmp_buffer)) {
if (setjmp(*pjerr->setjmp_buffer)) {
jpeg_destroy_compress(pcinfo);

*destinationSizePtr = 0;
Expand Down Expand Up @@ -133,6 +134,7 @@ primJPEGWriteImageonByteArrayformqualityprogressiveJPEGerrorMgrWriteScanlines(
jpeg_finish_compress(pcinfo);
jpeg_destroy_compress(pcinfo);
}
free(pjerr->setjmp_buffer);
}

void
Expand All @@ -152,9 +154,10 @@ primJPEGReadImagefromByteArrayonFormdoDitheringerrorMgrReadScanlines(

int ok = 1;
pcinfo->err = jpeg_std_error(&pjerr->pub);
pjerr->setjmp_buffer = (jmp_buf *) malloc(sizeof(jmp_buf));
pjerr->pub.error_exit = error_exit;

if (setjmp(pjerr->setjmp_buffer)) {
if (setjmp(*pjerr->setjmp_buffer)) {
jpeg_destroy_decompress(pcinfo);
ok = 0;
}
Expand Down Expand Up @@ -280,6 +283,7 @@ primJPEGReadImagefromByteArrayonFormdoDitheringerrorMgrReadScanlines(
jpeg_finish_decompress(pcinfo);
jpeg_destroy_decompress(pcinfo);
}
free(pjerr->setjmp_buffer);
}

void
Expand All @@ -293,9 +297,10 @@ primJPEGReadHeaderfromByteArraysizeerrorMgrReadHeader(
error_ptr2 pjerr = (error_ptr2)jpegErrorMgr2Struct;

pcinfo->err = jpeg_std_error(&pjerr->pub);
pjerr->setjmp_buffer = (jmp_buf *) malloc(sizeof(jmp_buf));
pjerr->pub.error_exit = error_exit;

if (setjmp(pjerr->setjmp_buffer)) {
if (setjmp(*pjerr->setjmp_buffer)) {
jpeg_destroy_decompress(pcinfo);
sourceSize = 0;
}
Expand All @@ -305,4 +310,5 @@ primJPEGReadHeaderfromByteArraysizeerrorMgrReadHeader(
jpeg_mem_src(pcinfo, source, sourceSize);
jpeg_read_header(pcinfo, TRUE);
}
free(pjerr->setjmp_buffer);
}
2 changes: 1 addition & 1 deletion platforms/unix/config/configure.ac
Expand Up @@ -298,7 +298,7 @@ AC_CHECK_FUNC(_dyld_present, [

AC_CHECK_FUNCS(snprintf __snprintf,[break])

AC_FUNC_MMAP
AC_CHECK_FUNCS([mmap])
AC_FUNC_ALLOCA
AX_HAVE_EPOLL
AX_HAVE_EPOLL_PWAIT
Expand Down
3 changes: 3 additions & 0 deletions platforms/unix/config/ltmain.sh
Expand Up @@ -186,6 +186,9 @@ do
prev=execute_dlfiles
;;

--preserve-dup-deps)
;;

-*)
$echo "$modename: unrecognized option \`$arg'" 1>&2
$echo "$help" 1>&2
Expand Down
2 changes: 1 addition & 1 deletion platforms/unix/plugins/XDisplayControlPlugin/Makefile.inc
Expand Up @@ -5,4 +5,4 @@ XLDFLAGS= $(X_LIBS) -L. -lvm-display-X11
$(TARGET): libvm-display-X11.so

libvm-display-X11.so:
ln -s ../vm-display-X11/.libs/vm-display-X11 libvm-display-X11.so
ln -s ../vm-display-X11/.libs/vm-display-X11.so libvm-display-X11.so

0 comments on commit 7e72650

Please sign in to comment.