]> granicus.if.org Git - php/commitdiff
emalloc() -> safe_emalloc()
authorIlia Alshanetsky <iliaa@php.net>
Tue, 23 Jan 2007 00:23:17 +0000 (00:23 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Tue, 23 Jan 2007 00:23:17 +0000 (00:23 +0000)
ext/exif/exif.c

index d639d31abd77e1bb8e4246c63bbf767eba98bf10..d44ca16ba96035214455e040af30b836dd13a869 100644 (file)
@@ -1606,7 +1606,7 @@ static int exif_file_sections_add(image_info_type *ImageInfo, int type, size_t s
        if (!size) {
                data = NULL;
        } else if (data == NULL) {
-               data = emalloc(size);
+               data = safe_emalloc(size, 1, 0);
        }
        ImageInfo->file.list[count].type = type;
        ImageInfo->file.list[count].data = data;
@@ -2383,7 +2383,7 @@ static void* exif_ifd_make_value(image_info_data *info_data, int motorola_intel
        image_info_value  *info_value;
 
        byte_count = php_tiff_bytes_per_format[info_data->format] * info_data->length;
-       value_ptr = emalloc(max(byte_count, 4));
+       value_ptr = safe_emalloc(max(byte_count, 4), 1, 0);
        memset(value_ptr, 0, 4);
        if (!info_data->length) {
                return value_ptr;
@@ -2875,7 +2875,7 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
                        }
                        if (byte_count>sizeof(cbuf)) {
                                /* mark as outside range and get buffer */
-                               value_ptr = emalloc(byte_count);
+                               value_ptr = safe_emalloc(byte_count, 1, 0);
                                outside = value_ptr;
                        } else {
                                /*