[Mapserver-dev] bug in mapswf.c (msDrawLabelCacheSWF)?

Steve Spicklemire steve at spvi.com
Tue Dec 2 23:13:41 EST 2003


Hi Yewondwossen,

Yes.. please send me your patch.. and I'll test it!

thanks,
-steve

On Dec 2, 2003, at 4:55 PM, Yewondwossen Assefa wrote:

> 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
>> _______________________________________________
>> Mapserver-dev mailing list
>> Mapserver-dev at lists.gis.umn.edu
>> http://lists.gis.umn.edu/mailman/listinfo/mapserver-dev
>
>
> -- 
> ----------------------------------------------------------------
> Assefa Yewondwossen
> Software Analyst
>
> Email: assefa at dmsolutions.ca
> http://www.dmsolutions.ca/
>
> Phone: (613) 565-5056 (ext 14)
> Fax:   (613) 565-0925
> ----------------------------------------------------------------
>
>
>
> _______________________________________________
> Mapserver-dev mailing list
> Mapserver-dev at lists.gis.umn.edu
> http://lists.gis.umn.edu/mailman/listinfo/mapserver-dev




More information about the mapserver-dev mailing list