Guest User

Untitled

a guest
Jul 29th, 2012
34
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.71 KB | None | 0 0
  1. Safari plugin crashes on NPN_GetValue
  2. static bool mainNPObjectInvoke(NPObject *obj, NPIdentifier identifier, const NPVariant *args, uint32_t argCount, NPVariant *result)
  3. {
  4. printf("create main object");
  5. MainNPObject *mainObject = (MainNPObject *)obj;
  6.  
  7. if (identifier == methodIdentifiers[METHOD_ID_GET_DEVICES])
  8. {
  9. NPObject *windowObj = NULL;
  10. browser->getvalue(mainObject->npp, NPNVWindowNPObject, &windowObj);
  11. // it crashed here
  12. ....
  13. }
  14. }
  15.  
  16. NPObject *createMainNPObject(NPP npp)
  17. {
  18. MainNPObject *object = (MainNPObject *)browser->createobject(npp, &mainNPClass);
  19. object->npp = npp;
  20.  
  21. theMainObject = object;
  22.  
  23. return (NPObject *)object;
  24. }
  25.  
  26. NPError NPP_GetValue(NPP instance, NPPVariable variable, void *value)
  27. {
  28. PluginObject *obj = instance->pdata;
  29.  
  30. switch (variable) {
  31. case NPPVpluginCoreAnimationLayer:
  32. if (!obj->rootLayer)
  33. setupLayerHierarchy(obj);
  34.  
  35. *(CALayer **)value = obj->rootLayer;
  36.  
  37. return NPERR_NO_ERROR;
  38.  
  39. case NPPVpluginScriptableNPObject:
  40.  
  41. if (!obj->mainObject)
  42. {
  43. obj->mainObject = createMainNPObject(instance);
  44. }
  45. ....
  46. }
  47.  
  48. static NPObject *mainNPObjectAllocate(NPP npp, NPClass *class)
  49. {
  50. initializeIdentifiers();
  51.  
  52. MainNPObject *mainObject = malloc(sizeof(MainNPObject));
  53. mainObject->deviceManager = [[DeviceManager alloc] init];
  54.  
  55. return (NPObject *)mainObject;
  56. }
  57.  
  58. typedef struct
  59. {
  60. NPObject *npobject;
  61. NPP npp;
  62. DeviceManager *deviceManager;
  63. } MainNPObject;
  64.  
  65. 0x00007fff83f82dab <+0019> je 0x7fff83f82db9 <_ZN6WebKit14NetscapePlugin7fromNPPEP4_NPP+33>
  66. 0x00007fff83f82dad <+0021> incl 0x8(%rax)
Advertisement
Add Comment
Please, Sign In to add comment