La fonction 'OpenADefaultComponent' de QuickTime plante dans une application écrite avec CodeWarrior 8.3
1 réponse
Philippe Legroux
Premièrement, ma configuration est la suivante :
- iMac 700 MHZ / 128 Mo
- Mac OS 10.2.6
- CodeWarrior 8.3
- Universal Headers 3.4.2
- Toutes les librairies ont été reconstruites
- QuickTime 6.3
Dans une application qui utilise QuickTime pour compresser une image
provenant du presse-papiers, la fonction 'OpenADefaultComponent' plante à
chaque fois.
Ci-dessous le code incriminé, suivi du crash log.
// Check to make sure the image compression manager is installed
Err=Gestalt(gestaltCompressionMgr, &response);
if ((Err != noErr) || (response < 15))
return (OSErr)Err;
thePict = (PicHandle)NewHandle(4);
if (!thePict)
return (OSErr)memFullErr;
// get the Picture from the scrap
HLock((Handle)thePict);
lenScrap=myGetScrap((Handle)thePict, 'PICT');
if (lenScrap <= 0)
goto bail;
// open the standard compression component
// <!!!--- crash here ---!!!>
Err=OpenADefaultComponent(StandardCompressionType,
StandardCompressionSubType, &stdc);
// <!!!--- crash here ---!!!>
if ((Err!=noErr) || (!stdc))
goto bail;
cr=SCDefaultPictHandleSettings(stdc, thePict, 0);
/*
... other code
*/
bail:
if (thePict) KillPicture(thePict);
if (stdc) CloseComponent(stdc);
Exception: EXC_BAD_ACCESS (0x0001)
Codes: KERN_INVALID_ADDRESS (0x0001) at 0x88660098
Thread 0 Crashed:
#0 0x90004bc8 in szone_malloc
#1 0x90004a44 in malloc_zone_malloc
#2 0x90235cd4 in RegisterComponentResourcePtr
#3 0x90247e40 in RegisterSystemComponentsClient
#4 0x902741b8 in registerSystemComponents
#5 0x902300b4 in FindNextComponent
#6 0x9023c6e4 in OpenADefaultComponent
#7 0x001ac12c in ClipBoardCompress
#8 0x001b6cec in 0x1b6cec
#9 0x001b7d08 in DoEditMenu
#10 0x001b5594 in 0x1b5594
#11 0x001b49b0 in MainEvent
#12 0x001b4498 in main
Cette action est irreversible, confirmez la suppression du commentaire ?
Signaler le commentaire
Veuillez sélectionner un problème
Nudité
Violence
Harcèlement
Fraude
Vente illégale
Discours haineux
Terrorisme
Autre
Philippe Legroux
Le 17/07/2003 10:53, dans BB3C30C6.6B3%, « Philippe Legroux » a écrit :
Premièrement, ma configuration est la suivante :
- iMac 700 MHZ / 128 Mo - Mac OS 10.2.6 - CodeWarrior 8.3 - Universal Headers 3.4.2 - Toutes les librairies ont été reconstruites - QuickTime 6.3
Dans une application qui utilise QuickTime pour compresser une image provenant du presse-papiers, la fonction 'OpenADefaultComponent' plante à chaque fois. Ci-dessous le code incriminé, suivi du crash log.
// Check to make sure the image compression manager is installed Err=Gestalt(gestaltCompressionMgr, &response); if ((Err != noErr) || (response < 15)) return (OSErr)Err;
thePict = (PicHandle)NewHandle(4); if (!thePict) return (OSErr)memFullErr;
// get the Picture from the scrap HLock((Handle)thePict); lenScrap=myGetScrap((Handle)thePict, 'PICT'); if (lenScrap <= 0) goto bail;
// open the standard compression component // <!!!--- crash here ---!!!> Err=OpenADefaultComponent(StandardCompressionType, StandardCompressionSubType, &stdc); // <!!!--- crash here ---!!!> if ((Err!=noErr) || (!stdc)) goto bail;
cr=SCDefaultPictHandleSettings(stdc, thePict, 0);
/* ... other code */
bail: if (thePict) KillPicture(thePict); if (stdc) CloseComponent(stdc);
Exception: EXC_BAD_ACCESS (0x0001) Codes: KERN_INVALID_ADDRESS (0x0001) at 0x88660098
Thread 0 Crashed: #0 0x90004bc8 in szone_malloc #1 0x90004a44 in malloc_zone_malloc #2 0x90235cd4 in RegisterComponentResourcePtr #3 0x90247e40 in RegisterSystemComponentsClient #4 0x902741b8 in registerSystemComponents #5 0x902300b4 in FindNextComponent #6 0x9023c6e4 in OpenADefaultComponent #7 0x001ac12c in ClipBoardCompress #8 0x001b6cec in 0x1b6cec #9 0x001b7d08 in DoEditMenu #10 0x001b5594 in 0x1b5594 #11 0x001b49b0 in MainEvent #12 0x001b4498 in main
//////////////////////////
Quelqu'un a-t-il une suggestion ?
Merci d'avance.
Philippe L.
En fait j'ai trouvé la solution
Petit problème d'allocation mémoire pour hDest dans myGetScrap.
Désolé.
Philippe L.
Le 17/07/2003 10:53, dans BB3C30C6.6B3%philippe.legroux@wanadoo.fr,
« Philippe Legroux » <philippe.legroux@wanadoo.fr> a écrit :
Premièrement, ma configuration est la suivante :
- iMac 700 MHZ / 128 Mo
- Mac OS 10.2.6
- CodeWarrior 8.3
- Universal Headers 3.4.2
- Toutes les librairies ont été reconstruites
- QuickTime 6.3
Dans une application qui utilise QuickTime pour compresser une image
provenant du presse-papiers, la fonction 'OpenADefaultComponent' plante à
chaque fois.
Ci-dessous le code incriminé, suivi du crash log.
// Check to make sure the image compression manager is installed
Err=Gestalt(gestaltCompressionMgr, &response);
if ((Err != noErr) || (response < 15))
return (OSErr)Err;
thePict = (PicHandle)NewHandle(4);
if (!thePict)
return (OSErr)memFullErr;
// get the Picture from the scrap
HLock((Handle)thePict);
lenScrap=myGetScrap((Handle)thePict, 'PICT');
if (lenScrap <= 0)
goto bail;
// open the standard compression component
// <!!!--- crash here ---!!!>
Err=OpenADefaultComponent(StandardCompressionType,
StandardCompressionSubType, &stdc);
// <!!!--- crash here ---!!!>
if ((Err!=noErr) || (!stdc))
goto bail;
cr=SCDefaultPictHandleSettings(stdc, thePict, 0);
/*
... other code
*/
bail:
if (thePict) KillPicture(thePict);
if (stdc) CloseComponent(stdc);
Exception: EXC_BAD_ACCESS (0x0001)
Codes: KERN_INVALID_ADDRESS (0x0001) at 0x88660098
Thread 0 Crashed:
#0 0x90004bc8 in szone_malloc
#1 0x90004a44 in malloc_zone_malloc
#2 0x90235cd4 in RegisterComponentResourcePtr
#3 0x90247e40 in RegisterSystemComponentsClient
#4 0x902741b8 in registerSystemComponents
#5 0x902300b4 in FindNextComponent
#6 0x9023c6e4 in OpenADefaultComponent
#7 0x001ac12c in ClipBoardCompress
#8 0x001b6cec in 0x1b6cec
#9 0x001b7d08 in DoEditMenu
#10 0x001b5594 in 0x1b5594
#11 0x001b49b0 in MainEvent
#12 0x001b4498 in main
//////////////////////////
Quelqu'un a-t-il une suggestion ?
Merci d'avance.
Philippe L.
En fait j'ai trouvé la solution
Petit problème d'allocation mémoire pour hDest dans myGetScrap.
Le 17/07/2003 10:53, dans BB3C30C6.6B3%, « Philippe Legroux » a écrit :
Premièrement, ma configuration est la suivante :
- iMac 700 MHZ / 128 Mo - Mac OS 10.2.6 - CodeWarrior 8.3 - Universal Headers 3.4.2 - Toutes les librairies ont été reconstruites - QuickTime 6.3
Dans une application qui utilise QuickTime pour compresser une image provenant du presse-papiers, la fonction 'OpenADefaultComponent' plante à chaque fois. Ci-dessous le code incriminé, suivi du crash log.
// Check to make sure the image compression manager is installed Err=Gestalt(gestaltCompressionMgr, &response); if ((Err != noErr) || (response < 15)) return (OSErr)Err;
thePict = (PicHandle)NewHandle(4); if (!thePict) return (OSErr)memFullErr;
// get the Picture from the scrap HLock((Handle)thePict); lenScrap=myGetScrap((Handle)thePict, 'PICT'); if (lenScrap <= 0) goto bail;
// open the standard compression component // <!!!--- crash here ---!!!> Err=OpenADefaultComponent(StandardCompressionType, StandardCompressionSubType, &stdc); // <!!!--- crash here ---!!!> if ((Err!=noErr) || (!stdc)) goto bail;
cr=SCDefaultPictHandleSettings(stdc, thePict, 0);
/* ... other code */
bail: if (thePict) KillPicture(thePict); if (stdc) CloseComponent(stdc);
Exception: EXC_BAD_ACCESS (0x0001) Codes: KERN_INVALID_ADDRESS (0x0001) at 0x88660098
Thread 0 Crashed: #0 0x90004bc8 in szone_malloc #1 0x90004a44 in malloc_zone_malloc #2 0x90235cd4 in RegisterComponentResourcePtr #3 0x90247e40 in RegisterSystemComponentsClient #4 0x902741b8 in registerSystemComponents #5 0x902300b4 in FindNextComponent #6 0x9023c6e4 in OpenADefaultComponent #7 0x001ac12c in ClipBoardCompress #8 0x001b6cec in 0x1b6cec #9 0x001b7d08 in DoEditMenu #10 0x001b5594 in 0x1b5594 #11 0x001b49b0 in MainEvent #12 0x001b4498 in main
//////////////////////////
Quelqu'un a-t-il une suggestion ?
Merci d'avance.
Philippe L.
En fait j'ai trouvé la solution
Petit problème d'allocation mémoire pour hDest dans myGetScrap.