summaryrefslogtreecommitdiff
path: root/ext/ming/ming.c
diff options
context:
space:
mode:
authorRasmus Lerdorf <rasmus@php.net>2004-10-01 19:28:45 +0000
committerRasmus Lerdorf <rasmus@php.net>2004-10-01 19:28:45 +0000
commit3d85a5d8768ea58c387c81e4a47c9642171b69f7 (patch)
tree6fa1da6847294934f0de813416662210f47a6f64 /ext/ming/ming.c
parentb4a5314dc334617e610713f73df730e5da0191cf (diff)
downloadphp-git-3d85a5d8768ea58c387c81e4a47c9642171b69f7.tar.gz
Slightly different fix for HEAD for the ming output method BC breaking
change.
Diffstat (limited to 'ext/ming/ming.c')
-rw-r--r--ext/ming/ming.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/ext/ming/ming.c b/ext/ming/ming.c
index 9bad646777..8d7d7170bf 100644
--- a/ext/ming/ming.c
+++ b/ext/ming/ming.c
@@ -2207,25 +2207,28 @@ PHP_METHOD(swfmovie, output)
#ifdef HAVE_MING_ZLIB
zval **zlimit = NULL;
int limit = -1;
+ int argc = ZEND_NUM_ARGS();
int oldval = INT_MIN;
long out;
- if (zend_get_parameters_ex(1, &zlimit) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
+ if(argc) {
+ if (zend_get_parameters_ex(1, &zlimit) == FAILURE) {
+ WRONG_PARAM_COUNT;
+ }
- convert_to_long_ex(zlimit);
- limit = Z_LVAL_PP(zlimit);
+ convert_to_long_ex(zlimit);
+ limit = Z_LVAL_PP(zlimit);
- if ((limit < 0) || (limit > 9)) {
- php_error(E_WARNING,"compression level must be within 0..9");
- RETURN_FALSE;
+ if ((limit < 0) || (limit > 9)) {
+ php_error(E_WARNING,"compression level must be within 0..9");
+ RETURN_FALSE;
+ }
}
oldval = Ming_setSWFCompression(limit);
out = SWFMovie_output(movie, &phpByteOutputMethod, NULL);
- if (oldval >= -1 && oldval <= 9)
+ if (oldval >= -1 && oldval <= 9) {
Ming_setSWFCompression(oldval);
-
+ }
RETURN_LONG(out);
#else
RETURN_LONG(SWFMovie_output(movie, &phpByteOutputMethod, NULL));