[Swfdec-commits] 3 commits - swfdec/jpeg test/image
Benjamin Otte
company at kemper.freedesktop.org
Sun Jun 22 09:00:40 PDT 2008
swfdec/jpeg/jpeg_rgb_decoder.c | 6 ++--
test/image/Makefile.am | 9 ++++++
test/image/crash-0.6.6-1x1-jpeg-5.swf |binary
test/image/crash-0.6.6-1x1-jpeg-5.swf.png |binary
test/image/crash-0.6.6-1x1-jpeg-6.swf |binary
test/image/crash-0.6.6-1x1-jpeg-6.swf.png |binary
test/image/crash-0.6.6-1x1-jpeg-7.swf |binary
test/image/crash-0.6.6-1x1-jpeg-7.swf.png |binary
test/image/crash-0.6.6-1x1-jpeg-8.swf |binary
test/image/crash-0.6.6-1x1-jpeg-8.swf.png |binary
test/image/crash-0.6.6-1x1-jpeg.xml | 43 ++++++++++++++++++++++++++++++
11 files changed, 55 insertions(+), 3 deletions(-)
New commits:
commit e0277bf8869fc1721394c17bfa93a81bbf7a0bde
Merge: 0df43c7... de63a37...
Author: Benjamin Otte <otte at gnome.org>
Date: Sun Jun 22 18:00:10 2008 +0200
Merge branch '0.6'
commit de63a3721669b41526680e2d60d851a6702495d5
Author: Benjamin Otte <otte at gnome.org>
Date: Sun Jun 22 17:57:22 2008 +0200
add test for recent fix (fixes #16395)
diff --git a/test/image/Makefile.am b/test/image/Makefile.am
index 20d6be5..b982d47 100644
--- a/test/image/Makefile.am
+++ b/test/image/Makefile.am
@@ -53,6 +53,15 @@ EXTRA_DIST = \
crash-0.6.4-huge-image-8.swf \
crash-0.6.4-huge-image-8.swf.png \
crash-0.6.4-huge-image.xml \
+ crash-0.6.6-1x1-jpeg-5.swf \
+ crash-0.6.6-1x1-jpeg-5.swf.png \
+ crash-0.6.6-1x1-jpeg-6.swf \
+ crash-0.6.6-1x1-jpeg-6.swf.png \
+ crash-0.6.6-1x1-jpeg-7.swf \
+ crash-0.6.6-1x1-jpeg-7.swf.png \
+ crash-0.6.6-1x1-jpeg-8.swf \
+ crash-0.6.6-1x1-jpeg-8.swf.png \
+ crash-0.6.6-1x1-jpeg.xml \
default.stas \
default.sts \
definebits-palette-5.swf \
diff --git a/test/image/crash-0.6.6-1x1-jpeg-5.swf b/test/image/crash-0.6.6-1x1-jpeg-5.swf
new file mode 100644
index 0000000..8e11caa
Binary files /dev/null and b/test/image/crash-0.6.6-1x1-jpeg-5.swf differ
diff --git a/test/image/crash-0.6.6-1x1-jpeg-5.swf.png b/test/image/crash-0.6.6-1x1-jpeg-5.swf.png
new file mode 100644
index 0000000..fe9b022
Binary files /dev/null and b/test/image/crash-0.6.6-1x1-jpeg-5.swf.png differ
diff --git a/test/image/crash-0.6.6-1x1-jpeg-6.swf b/test/image/crash-0.6.6-1x1-jpeg-6.swf
new file mode 100644
index 0000000..42cbed6
Binary files /dev/null and b/test/image/crash-0.6.6-1x1-jpeg-6.swf differ
diff --git a/test/image/crash-0.6.6-1x1-jpeg-6.swf.png b/test/image/crash-0.6.6-1x1-jpeg-6.swf.png
new file mode 100644
index 0000000..8473f2b
Binary files /dev/null and b/test/image/crash-0.6.6-1x1-jpeg-6.swf.png differ
diff --git a/test/image/crash-0.6.6-1x1-jpeg-7.swf b/test/image/crash-0.6.6-1x1-jpeg-7.swf
new file mode 100644
index 0000000..646d0ad
Binary files /dev/null and b/test/image/crash-0.6.6-1x1-jpeg-7.swf differ
diff --git a/test/image/crash-0.6.6-1x1-jpeg-7.swf.png b/test/image/crash-0.6.6-1x1-jpeg-7.swf.png
new file mode 100644
index 0000000..6e7cb44
Binary files /dev/null and b/test/image/crash-0.6.6-1x1-jpeg-7.swf.png differ
diff --git a/test/image/crash-0.6.6-1x1-jpeg-8.swf b/test/image/crash-0.6.6-1x1-jpeg-8.swf
new file mode 100644
index 0000000..f4297e2
Binary files /dev/null and b/test/image/crash-0.6.6-1x1-jpeg-8.swf differ
diff --git a/test/image/crash-0.6.6-1x1-jpeg-8.swf.png b/test/image/crash-0.6.6-1x1-jpeg-8.swf.png
new file mode 100644
index 0000000..42ba869
Binary files /dev/null and b/test/image/crash-0.6.6-1x1-jpeg-8.swf.png differ
diff --git a/test/image/crash-0.6.6-1x1-jpeg.xml b/test/image/crash-0.6.6-1x1-jpeg.xml
new file mode 100644
index 0000000..1927575
--- /dev/null
+++ b/test/image/crash-0.6.6-1x1-jpeg.xml
@@ -0,0 +1,43 @@
+<?xml version="1.0"?>
+<swf version="7" compressed="1">
+ <Header framerate="1" frames="2">
+ <size>
+ <Rectangle left="0" right="4000" top="0" bottom="3000"/>
+ </size>
+ <tags>
+ <DefineBitsJPEG2 objectID="1">
+ <data>
+ <data>/9j/4AAQSkZJRgABAQEASABIAAD/4QAWRXhpZgAATU0AKgAAAAgAAAAAAAD//gATQ3JlYXRlZCB3aXRoIEdJTVD/2wBDAAUDBAQEAwUEBAQFBQUGBwwIBwcHBw8LCwkMEQ8SEhEPERETFhwXExQaFRERGCEYGh0dHx8fExciJCIeJBweHx7/2wBDAQUFBQcGBw4ICA4eFBEUHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh7/wAARCAABAAEDASIAAhEBAxEB/8QAFQABAQAAAAAAAAAAAAAAAAAAAAj/xAAUEAEAAAAAAAAAAAAAAAAAAAAA/8QAFQEBAQAAAAAAAAAAAAAAAAAABgj/xAAUEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwCfQFdhL//Z</data>
+ </data>
+ </DefineBitsJPEG2>
+ <DefineShape objectID="2">
+ <bounds>
+ <Rectangle left="1000" right="3000" top="1000" bottom="2000"/>
+ </bounds>
+ <styles>
+ <StyleList>
+ <fillStyles>
+ <TiledBitmap objectID="1" />
+ </fillStyles>
+ <lineStyles/>
+ </StyleList>
+ </styles>
+ <shapes>
+ <Shape>
+ <edges>
+ <ShapeSetup x="1000" y="1000" fillStyle0="1"/>
+ <LineTo x="2000" y="0"/>
+ <LineTo x="0" y="1000"/>
+ <LineTo x="-2000" y="0"/>
+ <LineTo x="0" y="-1000"/>
+ <ShapeSetup/>
+ </edges>
+ </Shape>
+ </shapes>
+ </DefineShape>
+ <PlaceObject2 depth="1" objectID="2" />
+ <ShowFrame />
+ <End/>
+ </tags>
+ </Header>
+</swf>
commit 75649df12e189ef5788b28e8132f2a44bdeb383e
Author: Benjamin Otte <otte at gnome.org>
Date: Sun Jun 22 17:56:51 2008 +0200
fix crash with 1-pixel wide JPEG images
diff --git a/swfdec/jpeg/jpeg_rgb_decoder.c b/swfdec/jpeg/jpeg_rgb_decoder.c
index 3c01914..412c8a8 100644
--- a/swfdec/jpeg/jpeg_rgb_decoder.c
+++ b/swfdec/jpeg/jpeg_rgb_decoder.c
@@ -116,9 +116,9 @@ upsample (uint8_t *d, uint8_t *s, int n)
d[i + 2] = (s[i/2] + 3*s[i/2+1] + 2)>>2;
}
- if (n&1) {
- i = n-3;
- d[n-2] = s[n/2];
+ if (n & 1) {
+ if (n > 1)
+ d[n-2] = s[n/2];
d[n-1] = s[n/2];
} else {
d[n-1] = s[n/2-1];
More information about the Swfdec-commits
mailing list