Opened 20 years ago

Closed 20 years ago

#503 closed defect (fixed)

msDrawLabelCacheSWF segfaults

Reported by: assefa Owned by: mapserverbugs
Priority: high Milestone:
Component: Output-SWF Version: 4.1
Severity: normal Keywords:
Cc:

Description

NOTE : this has been commited in mapswf.c r 1.33 but not yet tested.

e-mail related to this with Steve Spicklemire (steve@spvi.com)

Hi There,

 Thanks for pointing this out.

 I have done the modifications to the source code to avoid the problem.

  Although the changes you did should avoid the crash, there was a potential 
error when assigning image->img.swf->nCurrentMovie = cachePtr->layerindex 
since the movie index and the layer index are not in sync. The crash happened 
for layerindex > nLayerMovies but the assignment could also be wrong without a 
crash.

If you are willing to do the tests please contact me personally and I will 
send you the modifications before commiting the code. If not I will enter a 
bug and  commit the code when I will do proper testing on my side.

Late


Steve Spicklemire wrote:

>
> Hi (again) Mapserver folks,
>
> I have a map where msDrawLabelCacheSWF segfaults mapserver when 
OUTPUT_MOVIE=MULTIPLE. The problem is that if the last layer is not drawn, 
drawMap still tries to cache labels on that layer, and (mistakenly) tries to 
access the movie for that layer, which immediately segfaults since there is no 
movie for that layer (drawlayer never calls startlayer if the layer isn't 
visible).
>
> Anyway... this patch stops the crashing for me:
>
> Index: mapswf.c
> ===================================================================
> RCS file: /data2/cvsroot/mapserver/mapswf.c,v
> retrieving revision 1.31
> diff -C3 -r1.31 mapswf.c
> *** mapswf.c    16 Jul 2003 16:44:58 -0000      1.31
> --- mapswf.c    2 Dec 2003 20:53:18 -0000
> ***************
> *** 2119,2128 ****
>   /*      set the current layer so the label will be drawn in the         */
>   /*      using the correct SWF handle.                                   */
>   /* ==================================================================== */
> !         image->img.swf->nCurrentMovie = cachePtr->layerindex;
>
> !         //msImageStartLayerSWF(map, layerPtr, image);
> !         image->img.swf->nCurrentLayerIdx = cachePtr->layerindex;
>   /* ==================================================================== */
>   /*      at this point the layer (at the shape level is closed). So      */
>   /*      we will open it if necessary.                                   */
> --- 2119,2134 ----
>   /*      set the current layer so the label will be drawn in the         */
>   /*      using the correct SWF handle.                                   */
>   /* ==================================================================== */
> !
> !       if (cachePtr->layerindex >= image->img.swf->nLayerMovies) {
> !         continue;
> !       }
> !
> !       image->img.swf->nCurrentMovie = cachePtr->layerindex;
> !
>
> !       //msImageStartLayerSWF(map, layerPtr, image);
> !       image->img.swf->nCurrentLayerIdx = cachePtr->layerindex;
>   /* ==================================================================== */
>   /*      at this point the layer (at the shape level is closed). So      */
>   /*      we will open it if necessary.                                   */
>
>
> I've not seen any trouble with it so far..
>
> -steve

Change History (1)

comment:1 by assefa, 20 years ago

Resolution: fixed
Status: newclosed
Summary: msDrawLabelCacheSWF segfaults msDrawLabelCacheSWF segfaults
Corrected in r1.34.
Note: See TracTickets for help on using tickets.