Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 271502
Collapse All | Expand All

(-)magick/display.c (-13 / +26 lines)
Lines 13677-13682 Link Here
13677
  */
13677
  */
13678
  window_info.width=(unsigned int) image->columns;
13678
  window_info.width=(unsigned int) image->columns;
13679
  window_info.height=(unsigned int) image->rows;
13679
  window_info.height=(unsigned int) image->rows;
13680
  if ((image->columns != window_info.width) ||
13681
      (image->rows != window_info.height))
13682
    ThrowXWindowFatalException(XServerFatalError,"UnableToCreateXImage",
13683
      image->filename);
13680
  (void) FormatMagickString(geometry,MaxTextExtent,"%ux%u+0+0>",
13684
  (void) FormatMagickString(geometry,MaxTextExtent,"%ux%u+0+0>",
13681
    window_attributes.width,window_attributes.height);
13685
    window_attributes.width,window_attributes.height);
13682
  geometry_info.width=window_info.width;
13686
  geometry_info.width=window_info.width;
Lines 14221-14226 Link Here
14221
    timestamp,
14225
    timestamp,
14222
    update_time;
14226
    update_time;
14223
14227
14228
  unsigned int
14229
    height,
14230
    width;
14231
14224
  unsigned long
14232
  unsigned long
14225
    delay;
14233
    delay;
14226
14234
Lines 14359-14366 Link Here
14359
  windows->context.id=(Window) NULL;
14367
  windows->context.id=(Window) NULL;
14360
  XGetWindowInfo(display,visual_info,map_info,pixel,font_info,
14368
  XGetWindowInfo(display,visual_info,map_info,pixel,font_info,
14361
    resource_info,&windows->context);
14369
    resource_info,&windows->context);
14362
  CloneString(&class_hints->res_name,"superclass");
14370
  (void) CloneString(&class_hints->res_name,"superclass");
14363
  CloneString(&class_hints->res_class,resource_info->client_name);
14371
  (void) CloneString(&class_hints->res_class,resource_info->client_name);
14364
  manager_hints->flags=InputHint | StateHint;
14372
  manager_hints->flags=InputHint | StateHint;
14365
  manager_hints->input=MagickFalse;
14373
  manager_hints->input=MagickFalse;
14366
  manager_hints->initial_state=WithdrawnState;
14374
  manager_hints->initial_state=WithdrawnState;
Lines 14412-14418 Link Here
14412
  windows->icon.attributes.colormap=XDefaultColormap(display,
14420
  windows->icon.attributes.colormap=XDefaultColormap(display,
14413
    icon_visual->screen);
14421
    icon_visual->screen);
14414
  windows->icon.attributes.event_mask=ExposureMask | StructureNotifyMask;
14422
  windows->icon.attributes.event_mask=ExposureMask | StructureNotifyMask;
14415
  CloneString(&class_hints->res_name,"icon");
14423
  (void) CloneString(&class_hints->res_name,"icon");
14416
  manager_hints->flags=InputHint | StateHint;
14424
  manager_hints->flags=InputHint | StateHint;
14417
  manager_hints->input=MagickFalse;
14425
  manager_hints->input=MagickFalse;
14418
  manager_hints->initial_state=IconicState;
14426
  manager_hints->initial_state=IconicState;
Lines 14511-14517 Link Here
14511
        ButtonReleaseMask;
14519
        ButtonReleaseMask;
14512
      windows->backdrop.attributes.event_mask=ButtonPressMask | KeyPressMask |
14520
      windows->backdrop.attributes.event_mask=ButtonPressMask | KeyPressMask |
14513
        StructureNotifyMask;
14521
        StructureNotifyMask;
14514
      CloneString(&class_hints->res_name,"backdrop");
14522
      (void) CloneString(&class_hints->res_name,"backdrop");
14515
      manager_hints->flags=IconWindowHint | InputHint | StateHint;
14523
      manager_hints->flags=IconWindowHint | InputHint | StateHint;
14516
      manager_hints->icon_window=windows->icon.id;
14524
      manager_hints->icon_window=windows->icon.id;
14517
      manager_hints->input=MagickTrue;
14525
      manager_hints->input=MagickTrue;
Lines 14539-14547 Link Here
14539
        (windows->image.height/2);
14547
        (windows->image.height/2);
14540
    }
14548
    }
14541
  if (resource_info->name == (char *) NULL)
14549
  if (resource_info->name == (char *) NULL)
14542
    CloneString(&class_hints->res_name,resource_info->client_name);
14550
    (void) CloneString(&class_hints->res_name,resource_info->client_name);
14543
  else
14551
  else
14544
    CloneString(&class_hints->res_name,resource_info->name);
14552
    (void) CloneString(&class_hints->res_name,resource_info->name);
14545
  manager_hints->flags=IconWindowHint | InputHint | StateHint;
14553
  manager_hints->flags=IconWindowHint | InputHint | StateHint;
14546
  manager_hints->icon_window=windows->icon.id;
14554
  manager_hints->icon_window=windows->icon.id;
14547
  manager_hints->input=MagickTrue;
14555
  manager_hints->input=MagickTrue;
Lines 14584-14590 Link Here
14584
  windows->info.attributes.win_gravity=UnmapGravity;
14592
  windows->info.attributes.win_gravity=UnmapGravity;
14585
  windows->info.attributes.event_mask=ButtonPressMask | ExposureMask |
14593
  windows->info.attributes.event_mask=ButtonPressMask | ExposureMask |
14586
    StructureNotifyMask;
14594
    StructureNotifyMask;
14587
  CloneString(&class_hints->res_name,"info");
14595
  (void) CloneString(&class_hints->res_name,"info");
14588
  manager_hints->flags=InputHint | StateHint | WindowGroupHint;
14596
  manager_hints->flags=InputHint | StateHint | WindowGroupHint;
14589
  manager_hints->input=MagickFalse;
14597
  manager_hints->input=MagickFalse;
14590
  manager_hints->initial_state=NormalState;
14598
  manager_hints->initial_state=NormalState;
Lines 14618-14624 Link Here
14618
  windows->command.attributes.event_mask=ButtonMotionMask | ButtonPressMask |
14626
  windows->command.attributes.event_mask=ButtonMotionMask | ButtonPressMask |
14619
    ButtonReleaseMask | EnterWindowMask | ExposureMask | LeaveWindowMask |
14627
    ButtonReleaseMask | EnterWindowMask | ExposureMask | LeaveWindowMask |
14620
    OwnerGrabButtonMask | StructureNotifyMask;
14628
    OwnerGrabButtonMask | StructureNotifyMask;
14621
  CloneString(&class_hints->res_name,"command");
14629
  (void) CloneString(&class_hints->res_name,"command");
14622
  manager_hints->flags=InputHint | StateHint | WindowGroupHint;
14630
  manager_hints->flags=InputHint | StateHint | WindowGroupHint;
14623
  manager_hints->input=MagickTrue;
14631
  manager_hints->input=MagickTrue;
14624
  manager_hints->initial_state=NormalState;
14632
  manager_hints->initial_state=NormalState;
Lines 14651-14657 Link Here
14651
    ButtonReleaseMask | EnterWindowMask | ExposureMask | KeyPressMask |
14659
    ButtonReleaseMask | EnterWindowMask | ExposureMask | KeyPressMask |
14652
    KeyReleaseMask | LeaveWindowMask | OwnerGrabButtonMask |
14660
    KeyReleaseMask | LeaveWindowMask | OwnerGrabButtonMask |
14653
    StructureNotifyMask;
14661
    StructureNotifyMask;
14654
  CloneString(&class_hints->res_name,"widget");
14662
  (void) CloneString(&class_hints->res_name,"widget");
14655
  manager_hints->flags=InputHint | StateHint | WindowGroupHint;
14663
  manager_hints->flags=InputHint | StateHint | WindowGroupHint;
14656
  manager_hints->input=MagickTrue;
14664
  manager_hints->input=MagickTrue;
14657
  manager_hints->initial_state=NormalState;
14665
  manager_hints->initial_state=NormalState;
Lines 14676-14682 Link Here
14676
  windows->popup.attributes.event_mask=ButtonMotionMask | ButtonPressMask |
14684
  windows->popup.attributes.event_mask=ButtonMotionMask | ButtonPressMask |
14677
    ButtonReleaseMask | EnterWindowMask | ExposureMask | KeyPressMask |
14685
    ButtonReleaseMask | EnterWindowMask | ExposureMask | KeyPressMask |
14678
    KeyReleaseMask | LeaveWindowMask | StructureNotifyMask;
14686
    KeyReleaseMask | LeaveWindowMask | StructureNotifyMask;
14679
  CloneString(&class_hints->res_name,"popup");
14687
  (void) CloneString(&class_hints->res_name,"popup");
14680
  manager_hints->flags=InputHint | StateHint | WindowGroupHint;
14688
  manager_hints->flags=InputHint | StateHint | WindowGroupHint;
14681
  manager_hints->input=MagickTrue;
14689
  manager_hints->input=MagickTrue;
14682
  manager_hints->initial_state=NormalState;
14690
  manager_hints->initial_state=NormalState;
Lines 14724-14730 Link Here
14724
  windows->magnify.attributes.event_mask=ButtonPressMask | ButtonReleaseMask |
14732
  windows->magnify.attributes.event_mask=ButtonPressMask | ButtonReleaseMask |
14725
    ExposureMask | KeyPressMask | KeyReleaseMask | OwnerGrabButtonMask |
14733
    ExposureMask | KeyPressMask | KeyReleaseMask | OwnerGrabButtonMask |
14726
    StructureNotifyMask;
14734
    StructureNotifyMask;
14727
  CloneString(&class_hints->res_name,"magnify");
14735
  (void) CloneString(&class_hints->res_name,"magnify");
14728
  manager_hints->flags=InputHint | StateHint | WindowGroupHint;
14736
  manager_hints->flags=InputHint | StateHint | WindowGroupHint;
14729
  manager_hints->input=MagickTrue;
14737
  manager_hints->input=MagickTrue;
14730
  manager_hints->initial_state=NormalState;
14738
  manager_hints->initial_state=NormalState;
Lines 14754-14760 Link Here
14754
  windows->pan.attributes.event_mask=ButtonMotionMask | ButtonPressMask |
14762
  windows->pan.attributes.event_mask=ButtonMotionMask | ButtonPressMask |
14755
    ButtonReleaseMask | ExposureMask | KeyPressMask | KeyReleaseMask |
14763
    ButtonReleaseMask | ExposureMask | KeyPressMask | KeyReleaseMask |
14756
    StructureNotifyMask;
14764
    StructureNotifyMask;
14757
  CloneString(&class_hints->res_name,"pan");
14765
  (void) CloneString(&class_hints->res_name,"pan");
14758
  manager_hints->flags=InputHint | StateHint | WindowGroupHint;
14766
  manager_hints->flags=InputHint | StateHint | WindowGroupHint;
14759
  manager_hints->input=MagickFalse;
14767
  manager_hints->input=MagickFalse;
14760
  manager_hints->initial_state=NormalState;
14768
  manager_hints->initial_state=NormalState;
Lines 14786-14793 Link Here
14786
  windows->image.x=0;
14794
  windows->image.x=0;
14787
  windows->image.y=0;
14795
  windows->image.y=0;
14788
  windows->magnify.shape=MagickFalse;
14796
  windows->magnify.shape=MagickFalse;
14797
  width=(unsigned int) display_image->columns;
14798
  height=(unsigned int) display_image->rows;
14799
  if ((display_image->columns != width) || (display_image->rows != height))
14800
    ThrowXWindowFatalException(XServerFatalError,"UnableToCreateXImage",
14801
      display_image->filename);
14789
  status=XMakeImage(display,resource_info,&windows->image,display_image,
14802
  status=XMakeImage(display,resource_info,&windows->image,display_image,
14790
    (unsigned int) display_image->columns,(unsigned int) display_image->rows);
14803
    width,height);
14791
  if (status == MagickFalse)
14804
  if (status == MagickFalse)
14792
    ThrowXWindowFatalException(XServerFatalError,"UnableToCreateXImage",
14805
    ThrowXWindowFatalException(XServerFatalError,"UnableToCreateXImage",
14793
      display_image->filename);
14806
      display_image->filename);
(-)magick/xwindow.c (-9 / +15 lines)
Lines 5368-5373 Link Here
5368
  const XResourceInfo *resource_info,XWindowInfo *window,Image *image,
5368
  const XResourceInfo *resource_info,XWindowInfo *window,Image *image,
5369
  unsigned int width,unsigned int height)
5369
  unsigned int width,unsigned int height)
5370
{
5370
{
5371
#define CheckOverflowException(length,width,height) \
5372
  (((height) != 0) && ((length)/((size_t) height) != ((size_t) width)))
5373
5371
  int
5374
  int
5372
    depth,
5375
    depth,
5373
    format;
5376
    format;
Lines 5507-5515 Link Here
5507
        (char *) NULL,&segment_info[1],width,height);
5510
        (char *) NULL,&segment_info[1],width,height);
5508
      if (ximage == (XImage *) NULL)
5511
      if (ximage == (XImage *) NULL)
5509
        window->shared_memory=MagickFalse;
5512
        window->shared_memory=MagickFalse;
5513
      length=(size_t) ximage->bytes_per_line*ximage->height;
5514
      if (CheckOverflowException(length,ximage->bytes_per_line,ximage->height))
5515
        window->shared_memory=MagickFalse;
5510
      if (window->shared_memory != MagickFalse)
5516
      if (window->shared_memory != MagickFalse)
5511
        segment_info[1].shmid=shmget(IPC_PRIVATE,(unsigned int)
5517
        segment_info[1].shmid=shmget(IPC_PRIVATE,length,IPC_CREAT | 0777);
5512
          (ximage->bytes_per_line*ximage->height),IPC_CREAT | 0777);
5513
      if (window->shared_memory != MagickFalse)
5518
      if (window->shared_memory != MagickFalse)
5514
        segment_info[1].shmaddr=(char *) shmat(segment_info[1].shmid,0,0);
5519
        segment_info[1].shmaddr=(char *) shmat(segment_info[1].shmid,0,0);
5515
      if (segment_info[1].shmid < 0)
5520
      if (segment_info[1].shmid < 0)
Lines 5612-5622 Link Here
5612
    }
5617
    }
5613
  if (window->shared_memory == MagickFalse)
5618
  if (window->shared_memory == MagickFalse)
5614
    {
5619
    {
5615
      if (ximage->format == XYBitmap)
5620
      if (ximage->format != XYBitmap)
5616
        length=(size_t) ximage->bytes_per_line*ximage->height*ximage->depth;
5621
        ximage->data=(char *) AcquireQuantumMemory((size_t)
5622
          ximage->bytes_per_line,(size_t) ximage->height);
5617
      else
5623
      else
5618
        length=(size_t) ximage->bytes_per_line*ximage->height;
5624
        ximage->data=(char *) AcquireQuantumMemory((size_t)
5619
      ximage->data=(char *)  malloc(length);
5625
          ximage->bytes_per_line*ximage->depth,(size_t) ximage->height);
5620
    }
5626
    }
5621
  if (ximage->data == (char *) NULL)
5627
  if (ximage->data == (char *) NULL)
5622
    {
5628
    {
Lines 5694-5702 Link Here
5694
            /*
5700
            /*
5695
              Allocate matte image pixel data.
5701
              Allocate matte image pixel data.
5696
            */
5702
            */
5697
            length=(size_t) matte_image->bytes_per_line*
5703
            matte_image->data=(char *) AcquireQuantumMemory((size_t)
5698
              matte_image->height*matte_image->depth;
5704
              matte_image->bytes_per_line*matte_image->depth,
5699
            matte_image->data=(char *) malloc(length);
5705
              (size_t) matte_image->height);
5700
            if (matte_image->data == (char *) NULL)
5706
            if (matte_image->data == (char *) NULL)
5701
              {
5707
              {
5702
                XDestroyImage(matte_image);
5708
                XDestroyImage(matte_image);
(-)magick/animate.c (-28 / +46 lines)
Lines 938-943 Link Here
938
  */
938
  */
939
  window_info.width=(unsigned int) image_list[0]->columns;
939
  window_info.width=(unsigned int) image_list[0]->columns;
940
  window_info.height=(unsigned int) image_list[0]->rows;
940
  window_info.height=(unsigned int) image_list[0]->rows;
941
  if ((image_list[0]->columns != window_info.width) ||
942
      (image_list[0]->rows != window_info.height))
943
    ThrowXWindowFatalException(XServerFatalError,"UnableToCreateXImage",
944
      image_list[0]->filename);
941
  (void) FormatMagickString(geometry,MaxTextExtent,"%ux%u+0+0>",
945
  (void) FormatMagickString(geometry,MaxTextExtent,"%ux%u+0+0>",
942
    window_attributes.width,window_attributes.height);
946
    window_attributes.width,window_attributes.height);
943
  geometry_info.width=window_info.width;
947
  geometry_info.width=window_info.width;
Lines 1053-1058 Link Here
1053
  window_info.matte_pixmaps[0]=window_info.pixmap;
1057
  window_info.matte_pixmaps[0]=window_info.pixmap;
1054
  for (scene=1; scene < (int) number_scenes; scene++)
1058
  for (scene=1; scene < (int) number_scenes; scene++)
1055
  {
1059
  {
1060
    unsigned int
1061
      columns,
1062
      rows;
1063
1056
    /*
1064
    /*
1057
      Create X image.
1065
      Create X image.
1058
    */
1066
    */
Lines 1064-1081 Link Here
1064
      if (image_list[scene]->storage_class == PseudoClass)
1072
      if (image_list[scene]->storage_class == PseudoClass)
1065
        XGetPixelPacket(display,visual_info,map_info,&resources,
1073
        XGetPixelPacket(display,visual_info,map_info,&resources,
1066
          image_list[scene],window_info.pixel_info);
1074
          image_list[scene],window_info.pixel_info);
1075
    columns=(unsigned int) image_list[scene]->columns;
1076
    rows=(unsigned int) image_list[scene]->rows;
1077
    if ((image_list[scene]->columns != columns) ||
1078
        (image_list[scene]->rows != rows))
1079
      ThrowXWindowFatalException(XServerFatalError,"UnableToCreateXImage",
1080
        image_list[scene]->filename);
1067
    status=XMakeImage(display,&resources,&window_info,image_list[scene],
1081
    status=XMakeImage(display,&resources,&window_info,image_list[scene],
1068
      (unsigned int) image_list[scene]->columns,
1082
      columns,rows);
1069
      (unsigned int) image_list[scene]->rows);
1070
    if (status == MagickFalse)
1083
    if (status == MagickFalse)
1071
      ThrowXWindowFatalException(XServerFatalError,"UnableToCreateXImage",
1084
      ThrowXWindowFatalException(XServerFatalError,"UnableToCreateXImage",
1072
        images->filename);
1085
        images->filename);
1073
    if (display_image->debug != MagickFalse)
1086
    if (display_image->debug != MagickFalse)
1074
      {
1087
      {
1075
        (void) LogMagickEvent(X11Event,GetMagickModule(),
1088
        (void) LogMagickEvent(X11Event,GetMagickModule(),
1076
          "Image: [%lu] %s %lux%lu ",image_list[scene]->scene,
1089
          "Image: [%lu] %s %ux%u ",image_list[scene]->scene,
1077
          image_list[scene]->filename,image_list[scene]->columns,
1090
          image_list[scene]->filename,columns,rows);
1078
          image_list[scene]->rows);
1079
        if (image_list[scene]->colors != 0)
1091
        if (image_list[scene]->colors != 0)
1080
          (void) LogMagickEvent(X11Event,GetMagickModule(),"%luc ",
1092
          (void) LogMagickEvent(X11Event,GetMagickModule(),"%luc ",
1081
            image_list[scene]->colors);
1093
            image_list[scene]->colors);
Lines 1085-1103 Link Here
1085
    /*
1097
    /*
1086
      Create the X pixmap.
1098
      Create the X pixmap.
1087
    */
1099
    */
1088
    window_info.pixmap=XCreatePixmap(display,window_info.id,
1100
    window_info.pixmap=XCreatePixmap(display,window_info.id,width,height,
1089
      (unsigned int) width,(unsigned int) height,window_info.depth);
1101
      window_info.depth);
1090
    if (window_info.pixmap == (Pixmap) NULL)
1102
    if (window_info.pixmap == (Pixmap) NULL)
1091
      ThrowXWindowFatalException(XServerFatalError,"UnableToCreateXPixmap",
1103
      ThrowXWindowFatalException(XServerFatalError,"UnableToCreateXPixmap",
1092
        images->filename);
1104
        images->filename);
1093
    /*
1105
    /*
1094
      Display pixmap on the window.
1106
      Display pixmap on the window.
1095
    */
1107
    */
1096
    if (((unsigned int) width > window_info.width) ||
1108
    if ((width > window_info.width) || (height > window_info.height))
1097
        ((unsigned int) height > window_info.height))
1098
      (void) XFillRectangle(display,window_info.pixmap,
1109
      (void) XFillRectangle(display,window_info.pixmap,
1099
        window_info.annotate_context,0,0,(unsigned int) width,
1110
        window_info.annotate_context,0,0,width,height);
1100
        (unsigned int) height);
1101
    (void) XPutImage(display,window_info.pixmap,window_info.annotate_context,
1111
    (void) XPutImage(display,window_info.pixmap,window_info.annotate_context,
1102
      window_info.ximage,0,0,window_info.x,window_info.y,window_info.width,
1112
      window_info.ximage,0,0,window_info.x,window_info.y,window_info.width,
1103
      window_info.height);
1113
      window_info.height);
Lines 1536-1543 Link Here
1536
  windows->context.id=(Window) NULL;
1546
  windows->context.id=(Window) NULL;
1537
  XGetWindowInfo(display,visual_info,map_info,pixel,font_info,
1547
  XGetWindowInfo(display,visual_info,map_info,pixel,font_info,
1538
    resource_info,&windows->context);
1548
    resource_info,&windows->context);
1539
  CloneString(&class_hints->res_name,"superclass");
1549
  (void) CloneString(&class_hints->res_name,"superclass");
1540
  CloneString(&class_hints->res_class,"Display");
1550
  (void) CloneString(&class_hints->res_class,"Display");
1541
  manager_hints->flags=InputHint | StateHint;
1551
  manager_hints->flags=InputHint | StateHint;
1542
  manager_hints->input=MagickFalse;
1552
  manager_hints->input=MagickFalse;
1543
  manager_hints->initial_state=WithdrawnState;
1553
  manager_hints->initial_state=WithdrawnState;
Lines 1589-1595 Link Here
1589
  windows->icon.attributes.colormap=
1599
  windows->icon.attributes.colormap=
1590
    XDefaultColormap(display,icon_visual->screen);
1600
    XDefaultColormap(display,icon_visual->screen);
1591
  windows->icon.attributes.event_mask=ExposureMask | StructureNotifyMask;
1601
  windows->icon.attributes.event_mask=ExposureMask | StructureNotifyMask;
1592
  CloneString(&class_hints->res_name,"icon");
1602
  (void) CloneString(&class_hints->res_name,"icon");
1593
  manager_hints->flags=InputHint | StateHint;
1603
  manager_hints->flags=InputHint | StateHint;
1594
  manager_hints->input=MagickFalse;
1604
  manager_hints->input=MagickFalse;
1595
  manager_hints->initial_state=IconicState;
1605
  manager_hints->initial_state=IconicState;
Lines 1684-1690 Link Here
1684
        ButtonReleaseMask;
1694
        ButtonReleaseMask;
1685
      windows->backdrop.attributes.event_mask=ButtonPressMask | KeyPressMask |
1695
      windows->backdrop.attributes.event_mask=ButtonPressMask | KeyPressMask |
1686
        StructureNotifyMask;
1696
        StructureNotifyMask;
1687
      CloneString(&class_hints->res_name,"backdrop");
1697
      (void) CloneString(&class_hints->res_name,"backdrop");
1688
      manager_hints->flags=IconWindowHint | InputHint | StateHint;
1698
      manager_hints->flags=IconWindowHint | InputHint | StateHint;
1689
      manager_hints->icon_window=windows->icon.id;
1699
      manager_hints->icon_window=windows->icon.id;
1690
      manager_hints->input=MagickTrue;
1700
      manager_hints->input=MagickTrue;
Lines 1712-1720 Link Here
1712
        (windows->image.height/2);
1722
        (windows->image.height/2);
1713
    }
1723
    }
1714
  if (resource_info->name == (char *) NULL)
1724
  if (resource_info->name == (char *) NULL)
1715
    CloneString(&class_hints->res_name,resource_info->client_name);
1725
    (void) CloneString(&class_hints->res_name,resource_info->client_name);
1716
  else
1726
  else
1717
    CloneString(&class_hints->res_name,resource_info->name);
1727
    (void) CloneString(&class_hints->res_name,resource_info->name);
1718
  manager_hints->flags=IconWindowHint | InputHint | StateHint;
1728
  manager_hints->flags=IconWindowHint | InputHint | StateHint;
1719
  manager_hints->icon_window=windows->icon.id;
1729
  manager_hints->icon_window=windows->icon.id;
1720
  manager_hints->input=MagickTrue;
1730
  manager_hints->input=MagickTrue;
Lines 1755-1763 Link Here
1755
  windows->info.y=2;
1765
  windows->info.y=2;
1756
  windows->info.flags|=PPosition;
1766
  windows->info.flags|=PPosition;
1757
  windows->info.attributes.win_gravity=UnmapGravity;
1767
  windows->info.attributes.win_gravity=UnmapGravity;
1758
  windows->info.attributes.event_mask=
1768
  windows->info.attributes.event_mask=ButtonPressMask | ExposureMask |
1759
    ButtonPressMask | ExposureMask | StructureNotifyMask;
1769
    StructureNotifyMask;
1760
  CloneString(&class_hints->res_name,"info");
1770
  (void) CloneString(&class_hints->res_name,"info");
1761
  manager_hints->flags=InputHint | StateHint | WindowGroupHint;
1771
  manager_hints->flags=InputHint | StateHint | WindowGroupHint;
1762
  manager_hints->input=MagickFalse;
1772
  manager_hints->input=MagickFalse;
1763
  manager_hints->initial_state=NormalState;
1773
  manager_hints->initial_state=NormalState;
Lines 1791-1797 Link Here
1791
  windows->command.attributes.event_mask=ButtonMotionMask | ButtonPressMask |
1801
  windows->command.attributes.event_mask=ButtonMotionMask | ButtonPressMask |
1792
    ButtonReleaseMask | EnterWindowMask | ExposureMask | LeaveWindowMask |
1802
    ButtonReleaseMask | EnterWindowMask | ExposureMask | LeaveWindowMask |
1793
    OwnerGrabButtonMask | StructureNotifyMask;
1803
    OwnerGrabButtonMask | StructureNotifyMask;
1794
  CloneString(&class_hints->res_name,"command");
1804
  (void) CloneString(&class_hints->res_name,"command");
1795
  manager_hints->flags=InputHint | StateHint | WindowGroupHint;
1805
  manager_hints->flags=InputHint | StateHint | WindowGroupHint;
1796
  manager_hints->input=MagickTrue;
1806
  manager_hints->input=MagickTrue;
1797
  manager_hints->initial_state=NormalState;
1807
  manager_hints->initial_state=NormalState;
Lines 1822-1828 Link Here
1822
    ButtonReleaseMask | EnterWindowMask | ExposureMask | KeyPressMask |
1832
    ButtonReleaseMask | EnterWindowMask | ExposureMask | KeyPressMask |
1823
    KeyReleaseMask | LeaveWindowMask | OwnerGrabButtonMask |
1833
    KeyReleaseMask | LeaveWindowMask | OwnerGrabButtonMask |
1824
    StructureNotifyMask;
1834
    StructureNotifyMask;
1825
  CloneString(&class_hints->res_name,"widget");
1835
  (void) CloneString(&class_hints->res_name,"widget");
1826
  manager_hints->flags=InputHint | StateHint | WindowGroupHint;
1836
  manager_hints->flags=InputHint | StateHint | WindowGroupHint;
1827
  manager_hints->input=MagickTrue;
1837
  manager_hints->input=MagickTrue;
1828
  manager_hints->initial_state=NormalState;
1838
  manager_hints->initial_state=NormalState;
Lines 1847-1853 Link Here
1847
  windows->popup.attributes.event_mask=ButtonMotionMask | ButtonPressMask |
1857
  windows->popup.attributes.event_mask=ButtonMotionMask | ButtonPressMask |
1848
    ButtonReleaseMask | EnterWindowMask | ExposureMask | KeyPressMask |
1858
    ButtonReleaseMask | EnterWindowMask | ExposureMask | KeyPressMask |
1849
    KeyReleaseMask | LeaveWindowMask | StructureNotifyMask;
1859
    KeyReleaseMask | LeaveWindowMask | StructureNotifyMask;
1850
  CloneString(&class_hints->res_name,"popup");
1860
  (void) CloneString(&class_hints->res_name,"popup");
1851
  manager_hints->flags=InputHint | StateHint | WindowGroupHint;
1861
  manager_hints->flags=InputHint | StateHint | WindowGroupHint;
1852
  manager_hints->input=MagickTrue;
1862
  manager_hints->input=MagickTrue;
1853
  manager_hints->initial_state=NormalState;
1863
  manager_hints->initial_state=NormalState;
Lines 1903-1908 Link Here
1903
  windows->image.matte_pixmaps[0]=windows->image.matte_pixmap;
1913
  windows->image.matte_pixmaps[0]=windows->image.matte_pixmap;
1904
  for (scene=1; scene < (long) number_scenes; scene++)
1914
  for (scene=1; scene < (long) number_scenes; scene++)
1905
  {
1915
  {
1916
    unsigned int
1917
      columns,
1918
      rows;
1919
1906
    /*
1920
    /*
1907
      Create X image.
1921
      Create X image.
1908
    */
1922
    */
Lines 1915-1932 Link Here
1915
      if (image_list[scene]->storage_class == PseudoClass)
1929
      if (image_list[scene]->storage_class == PseudoClass)
1916
        XGetPixelPacket(display,visual_info,map_info,resource_info,
1930
        XGetPixelPacket(display,visual_info,map_info,resource_info,
1917
          image_list[scene],windows->image.pixel_info);
1931
          image_list[scene],windows->image.pixel_info);
1932
    columns=(unsigned int) image_list[scene]->columns;
1933
    rows=(unsigned int) image_list[scene]->rows;
1934
    if ((image_list[scene]->columns != columns) ||
1935
        (image_list[scene]->rows != rows))
1936
      ThrowXWindowFatalException(XServerFatalError,"UnableToCreateXImage",
1937
        image_list[scene]->filename);
1918
    status=XMakeImage(display,resource_info,&windows->image,image_list[scene],
1938
    status=XMakeImage(display,resource_info,&windows->image,image_list[scene],
1919
      (unsigned int) image_list[scene]->columns,
1939
      columns,rows);
1920
      (unsigned int) image_list[scene]->rows);
1921
    if (status == MagickFalse)
1940
    if (status == MagickFalse)
1922
      ThrowXWindowFatalException(XServerFatalError,"UnableToCreateXImage",
1941
      ThrowXWindowFatalException(XServerFatalError,"UnableToCreateXImage",
1923
        images->filename);
1942
        images->filename);
1924
    if (image_list[scene]->debug != MagickFalse)
1943
    if (image_list[scene]->debug != MagickFalse)
1925
      {
1944
      {
1926
        (void) LogMagickEvent(X11Event,GetMagickModule(),
1945
        (void) LogMagickEvent(X11Event,GetMagickModule(),
1927
          "Image: [%lu] %s %lux%lu ",image_list[scene]->scene,
1946
          "Image: [%lu] %s %ux%u ",image_list[scene]->scene,
1928
          image_list[scene]->filename,image_list[scene]->columns,
1947
          image_list[scene]->filename,columns,rows);
1929
          image_list[scene]->rows);
1930
        if (image_list[scene]->colors != 0)
1948
        if (image_list[scene]->colors != 0)
1931
          (void) LogMagickEvent(X11Event,GetMagickModule(),"%luc ",
1949
          (void) LogMagickEvent(X11Event,GetMagickModule(),"%luc ",
1932
            image_list[scene]->colors);
1950
            image_list[scene]->colors);
(-)coders/xwd.c (-1 / +1 lines)
Lines 146-152 Link Here
146
static Image *ReadXWDImage(const ImageInfo *image_info,ExceptionInfo *exception)
146
static Image *ReadXWDImage(const ImageInfo *image_info,ExceptionInfo *exception)
147
{
147
{
148
#define CheckOverflowException(length,width,height) \
148
#define CheckOverflowException(length,width,height) \
149
   (((height) != 0) && ((length)/((size_t) height) != ((size_t) width)))
149
  (((height) != 0) && ((length)/((size_t) height) != ((size_t) width)))
150
150
151
  char
151
  char
152
    *comment;
152
    *comment;
(-)ChangeLog (+4 lines)
Lines 1-4 Link Here
1
2009-05-23  6.5.2-8 Cristy  <quetzlzacatenango@image...>
2
  * Check for XMakeImage() integer overflow vulnerability (Secunia Advisory
3
    SA35216).
4
1
2009-05-23  6.5.2-8 Cristy  <quetzlzacatenango@image...>
5
2009-05-23  6.5.2-8 Cristy  <quetzlzacatenango@image...>
2
  * Permit reading a specific frame of a multi-page TIFF with blobs.
6
  * Permit reading a specific frame of a multi-page TIFF with blobs.
3
7
4
2009-05-22  6.5.2-8 Anthony Thyssen <A.Thyssen@griffith...>
8
2009-05-22  6.5.2-8 Anthony Thyssen <A.Thyssen@griffith...>

Return to bug 271502