Changeset 693
- Timestamp:
- 11/10/11 23:00:27 (6 months ago)
- Files:
-
- 6 edited
-
branches/1.0/sources/thelib/src/protocols/rtmp/amf0serializer.cpp (modified) (15 diffs)
-
branches/1.0/sources/thelib/src/protocols/rtmp/basertmpprotocol.cpp (modified) (1 diff)
-
branches/1.0/sources/thelib/src/protocols/rtmp/rtmpprotocolserializer.cpp (modified) (17 diffs)
-
trunk/sources/thelib/src/protocols/rtmp/amf0serializer.cpp (modified) (15 diffs)
-
trunk/sources/thelib/src/protocols/rtmp/basertmpprotocol.cpp (modified) (1 diff)
-
trunk/sources/thelib/src/protocols/rtmp/rtmpprotocolserializer.cpp (modified) (17 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/1.0/sources/thelib/src/protocols/rtmp/amf0serializer.cpp
r625 r693 66 66 bool AMF0Serializer::ReadShortString(IOBuffer &buffer, Variant &variant, 67 67 bool readType) { 68 69 68 if (readType) { 70 69 AMF_CHECK_BOUNDARIES(buffer, 1); 71 70 if (GETIBPOINTER(buffer)[0] != AMF0_SHORT_STRING) { 72 FATAL("AMF type not valid: want: % hhu; got: %hhu",71 FATAL("AMF type not valid: want: %"PRIu8"; got: %"PRIu8, 73 72 AMF0_SHORT_STRING, GETIBPOINTER(buffer)[0]); 74 73 return false; … … 90 89 variant = string((char *) (GETIBPOINTER(buffer)), length); 91 90 if (!buffer.Ignore(length)) { 92 FATAL("Unable to ignore % hubytes", length);91 FATAL("Unable to ignore %"PRIu16" bytes", length); 93 92 return false; 94 93 } … … 112 111 AMF_CHECK_BOUNDARIES(buffer, 1); 113 112 if (GETIBPOINTER(buffer)[0] != AMF0_LONG_STRING) { 114 FATAL("AMF type not valid: want: % hhu; got: %hhu",113 FATAL("AMF type not valid: want: %"PRIu8"; got: %"PRIu8, 115 114 AMF0_LONG_STRING, GETIBPOINTER(buffer)[0]); 116 115 return false; … … 133 132 variant = string((char *) (GETIBPOINTER(buffer)), length); 134 133 if (!buffer.Ignore(length)) { 135 FATAL("Unable to ignore % ubytes", length);134 FATAL("Unable to ignore %"PRIu32" bytes", length); 136 135 return false; 137 136 } … … 156 155 AMF_CHECK_BOUNDARIES(buffer, 1); 157 156 if (GETIBPOINTER(buffer)[0] != AMF0_NUMBER) { 158 FATAL("AMF type not valid: want: % hhu; got: %hhu",157 FATAL("AMF type not valid: want: %"PRIu8"; got: %"PRIu8, 159 158 AMF0_NUMBER, GETIBPOINTER(buffer)[0]); 160 159 return false; … … 195 194 AMF_CHECK_BOUNDARIES(buffer, 1); 196 195 if (GETIBPOINTER(buffer)[0] != AMF0_OBJECT) { 197 FATAL("AMF type not valid: want: % hhu; got: %hhu",196 FATAL("AMF type not valid: want: %"PRIu8"; got: %"PRIu8, 198 197 AMF0_OBJECT, GETIBPOINTER(buffer)[0]); 199 198 return false; … … 294 293 AMF_CHECK_BOUNDARIES(buffer, 1); 295 294 if (GETIBPOINTER(buffer)[0] != AMF0_MIXED_ARRAY) { 296 FATAL("AMF type not valid: want: % hhu; got: %hhu",295 FATAL("AMF type not valid: want: %"PRIu8"; got: %"PRIu8, 297 296 AMF0_MIXED_ARRAY, GETIBPOINTER(buffer)[0]); 298 297 return false; … … 404 403 405 404 bool AMF0Serializer::ReadArray(IOBuffer &buffer, Variant &variant, bool readType) { 406 407 405 if (readType) { 408 406 AMF_CHECK_BOUNDARIES(buffer, 1); 409 407 if (GETIBPOINTER(buffer)[0] != AMF0_ARRAY) { 410 FATAL("AMF type not valid: want: % hhu; got: %hhu",408 FATAL("AMF type not valid: want: %"PRIu8"; got: %"PRIu8, 411 409 AMF0_ARRAY, GETIBPOINTER(buffer)[0]); 412 410 return false; … … 450 448 AMF_CHECK_BOUNDARIES(buffer, 1); 451 449 if (GETIBPOINTER(buffer)[0] != AMF0_AMF3_OBJECT) { 452 FATAL("AMF type not valid: want: % hhu; got: %hhu",450 FATAL("AMF type not valid: want: %"PRIu8"; got: %"PRIu8, 453 451 AMF0_AMF3_OBJECT, GETIBPOINTER(buffer)[0]); 454 452 return false; … … 486 484 AMF_CHECK_BOUNDARIES(buffer, 1); 487 485 if (GETIBPOINTER(buffer)[0] != AMF0_BOOLEAN) { 488 FATAL("AMF type not valid: want: % hhu; got: %hhu",486 FATAL("AMF type not valid: want: %"PRIu8"; got: %"PRIu8, 489 487 AMF0_BOOLEAN, GETIBPOINTER(buffer)[0]); 490 488 return false; … … 524 522 AMF_CHECK_BOUNDARIES(buffer, 1); 525 523 if (GETIBPOINTER(buffer)[0] != AMF0_TIMESTAMP) { 526 FATAL("AMF type not valid: want: % hhu; got: %hhu",524 FATAL("AMF type not valid: want: %"PRIu8"; got: %"PRIu8, 527 525 AMF0_TIMESTAMP, GETIBPOINTER(buffer)[0]); 528 526 return false; … … 538 536 if (!ReadDouble(buffer, doubleVariant, false)) { 539 537 FATAL("Unable to read the value"); 538 return false; 540 539 } 541 540 … … 569 568 AMF_CHECK_BOUNDARIES(buffer, 1); 570 569 if (GETIBPOINTER(buffer)[0] != AMF0_NULL) { 571 FATAL("AMF type not valid: want: % hhu; got: %hhu",570 FATAL("AMF type not valid: want: %"PRIu8"; got: %"PRIu8, 572 571 AMF0_NULL, GETIBPOINTER(buffer)[0]); 573 572 return false; … … 592 591 AMF_CHECK_BOUNDARIES(buffer, 1); 593 592 if (GETIBPOINTER(buffer)[0] != AMF0_UNDEFINED) { 594 FATAL("AMF type not valid: want: % hhu; got: %hhu",593 FATAL("AMF type not valid: want: %"PRIu8"; got: %"PRIu8, 595 594 AMF0_UNDEFINED, GETIBPOINTER(buffer)[0]); 596 595 return false; … … 728 727 default: 729 728 { 730 FATAL("Unable to de-serialize type % hhu; Buffer: %s",729 FATAL("Unable to de-serialize type %"PRIu8"; Buffer: %s", 731 730 GETIBPOINTER(buffer)[0], STR(buffer)); 732 731 return false; -
branches/1.0/sources/thelib/src/protocols/rtmp/basertmpprotocol.cpp
r650 r693 668 668 } 669 669 670 if (_selectedChannel >= MAX_CHANNELS_COUNT) { 671 FATAL("Bogus connection. Drop it like is hot"); 672 return false; 673 } 674 670 675 Channel &channel = _channels[_selectedChannel]; 671 676 Header &header = channel.lastInHeader; -
branches/1.0/sources/thelib/src/protocols/rtmp/rtmpprotocolserializer.cpp
r467 r693 21 21 #include "protocols/rtmp/rtmpprotocolserializer.h" 22 22 #include "protocols/rtmp/messagefactories/messagefactories.h" 23 #include "protocols/rtmp/amftypes.h" 23 24 24 25 RTMPProtocolSerializer::RTMPProtocolSerializer() { 25 26 27 26 } 28 27 29 28 RTMPProtocolSerializer::~RTMPProtocolSerializer() { 30 31 29 } 32 30 … … 453 451 uint32_t length = buffer.GetCurrentWritePosition() 454 452 - rawLengthPosition - 4; 455 EHTONLP(buffer.GetPointer() + rawLengthPosition, length);453 EHTONLP(buffer.GetPointer() + rawLengthPosition, length); 456 454 break; 457 455 } … … 511 509 512 510 bool RTMPProtocolSerializer::DeserializeFlexStreamSend(IOBuffer &buffer, Variant &message) { 513 if (GETAVAILABLEBYTESCOUNT(buffer) < 1) { 514 FATAL("Incorrect buffer:\n%s", STR(buffer)); 515 return false; 516 } 517 511 AMF_CHECK_BOUNDARIES(buffer, 1); 518 512 message[RM_FLEXSTREAMSEND_UNKNOWNBYTE] = (uint8_t) GETIBPOINTER(buffer)[0]; 519 520 513 if (!buffer.Ignore(1)) { 521 514 FATAL("Unable to ignore 1 byte"); … … 563 556 bool RTMPProtocolSerializer::DeserializeAck(IOBuffer &buffer, 564 557 Variant &message) { 558 AMF_CHECK_BOUNDARIES(buffer, 4); 565 559 message = (uint32_t) ENTOHLP(GETIBPOINTER(buffer)); //----MARKED-LONG--- 566 560 return buffer.Ignore(4); … … 568 562 569 563 bool RTMPProtocolSerializer::DeserializeUsrCtrl(IOBuffer &buffer, Variant &message) { 564 AMF_CHECK_BOUNDARIES(buffer, 2); 570 565 message[RM_USRCTRL_TYPE] = ENTOHSP(GETIBPOINTER(buffer)); //----MARKED-SHORT---- 571 566 message[RM_USRCTRL_TYPE_STRING] = GetUserCtrlTypeString(message[RM_USRCTRL_TYPE]); … … 581 576 case RM_USRCTRL_TYPE_STREAM_IS_RECORDED: 582 577 { 578 AMF_CHECK_BOUNDARIES(buffer, 4); 583 579 message[RM_USRCTRL_STREAMID] = ENTOHLP(GETIBPOINTER(buffer)); //----MARKED-LONG--- 584 580 if (!buffer.Ignore(4)) { … … 590 586 case RM_USRCTRL_TYPE_STREAM_SET_BUFFER_LENGTH: 591 587 { 588 AMF_CHECK_BOUNDARIES(buffer, 8); 592 589 message[RM_USRCTRL_STREAMID] = ENTOHLP(GETIBPOINTER(buffer)); //----MARKED-LONG--- 593 590 if (!buffer.Ignore(4)) { … … 604 601 case RM_USRCTRL_TYPE_PING_REQUEST: 605 602 { 603 AMF_CHECK_BOUNDARIES(buffer, 4); 606 604 message[RM_USRCTRL_PING] = ENTOHLP(GETIBPOINTER(buffer)); //----MARKED-LONG--- 607 605 if (!buffer.Ignore(4)) { … … 613 611 case RM_USRCTRL_TYPE_PING_RESPONSE: 614 612 { 613 AMF_CHECK_BOUNDARIES(buffer, 4); 615 614 message[RM_USRCTRL_PONG] = ENTOHLP(GETIBPOINTER(buffer)); //----MARKED-LONG--- 616 615 if (!buffer.Ignore(4)) { … … 623 622 case RM_USRCTRL_TYPE_UNKNOWN2: 624 623 { 624 AMF_CHECK_BOUNDARIES(buffer, 4); 625 625 message[RM_USRCTRL_UNKNOWN_U32] = ENTOHLP(GETIBPOINTER(buffer)); //----MARKED-LONG--- 626 626 if (!buffer.Ignore(4)) { … … 641 641 bool RTMPProtocolSerializer::DeserializeChunkSize(IOBuffer &buffer, 642 642 Variant &message) { 643 AMF_CHECK_BOUNDARIES(buffer, 4); 643 644 message = (uint32_t) ENTOHLP(GETIBPOINTER(buffer)); //----MARKED-LONG--- 644 645 return buffer.Ignore(4); … … 646 647 647 648 bool RTMPProtocolSerializer::DeserializeWinAckSize(IOBuffer &buffer, Variant &message) { 649 AMF_CHECK_BOUNDARIES(buffer, 4); 648 650 message = (uint32_t) ENTOHLP(GETIBPOINTER(buffer)); //----MARKED-LONG--- 649 651 return buffer.Ignore(4); … … 651 653 652 654 bool RTMPProtocolSerializer::DeserializePeerBW(IOBuffer &buffer, Variant &message) { 655 AMF_CHECK_BOUNDARIES(buffer, 4); 653 656 message[RM_PEERBW_VALUE] = (uint32_t) ENTOHLP(GETIBPOINTER(buffer)); //----MARKED-LONG--- 654 657 if (!buffer.Ignore(4)) { … … 661 664 662 665 bool RTMPProtocolSerializer::DeserializeAbortMessage(IOBuffer &buffer, Variant &message) { 666 AMF_CHECK_BOUNDARIES(buffer, 4); 663 667 message = (uint32_t) ENTOHLP(GETIBPOINTER(buffer)); //----MARKED-LONG--- 664 668 if (!buffer.Ignore(4)) { … … 671 675 bool RTMPProtocolSerializer::DeserializeFlexSharedObject(IOBuffer &buffer, 672 676 Variant &message) { 677 AMF_CHECK_BOUNDARIES(buffer, 1); 673 678 if (GETIBPOINTER(buffer)[0] != 0) { 674 FATAL("Encoding % hhunot supported yet", GETIBPOINTER(buffer)[0]);679 FATAL("Encoding %"PRIu8" not supported yet", GETIBPOINTER(buffer)[0]); 675 680 return false; 676 681 } … … 706 711 707 712 //4. Skip 4 unknown bytes 713 AMF_CHECK_BOUNDARIES(buffer, 4); 708 714 if (!buffer.Ignore(4)) { 709 715 FATAL("Unable to ignore 4 bytes"); … … 731 737 } 732 738 uint32_t rawLength = primitive[RM_SHAREDOBJECTPRIMITIVE_RAWLENGTH]; 733 if (GETAVAILABLEBYTESCOUNT(buffer) < rawLength) { 734 FATAL("Not enough data to parse a SO primitive"); 735 return false; 736 } 739 AMF_CHECK_BOUNDARIES(buffer, rawLength); 737 740 738 741 //8. Read the rest of the primitive based on it's type -
trunk/sources/thelib/src/protocols/rtmp/amf0serializer.cpp
r625 r693 66 66 bool AMF0Serializer::ReadShortString(IOBuffer &buffer, Variant &variant, 67 67 bool readType) { 68 69 68 if (readType) { 70 69 AMF_CHECK_BOUNDARIES(buffer, 1); 71 70 if (GETIBPOINTER(buffer)[0] != AMF0_SHORT_STRING) { 72 FATAL("AMF type not valid: want: % hhu; got: %hhu",71 FATAL("AMF type not valid: want: %"PRIu8"; got: %"PRIu8, 73 72 AMF0_SHORT_STRING, GETIBPOINTER(buffer)[0]); 74 73 return false; … … 90 89 variant = string((char *) (GETIBPOINTER(buffer)), length); 91 90 if (!buffer.Ignore(length)) { 92 FATAL("Unable to ignore % hubytes", length);91 FATAL("Unable to ignore %"PRIu16" bytes", length); 93 92 return false; 94 93 } … … 112 111 AMF_CHECK_BOUNDARIES(buffer, 1); 113 112 if (GETIBPOINTER(buffer)[0] != AMF0_LONG_STRING) { 114 FATAL("AMF type not valid: want: % hhu; got: %hhu",113 FATAL("AMF type not valid: want: %"PRIu8"; got: %"PRIu8, 115 114 AMF0_LONG_STRING, GETIBPOINTER(buffer)[0]); 116 115 return false; … … 133 132 variant = string((char *) (GETIBPOINTER(buffer)), length); 134 133 if (!buffer.Ignore(length)) { 135 FATAL("Unable to ignore % ubytes", length);134 FATAL("Unable to ignore %"PRIu32" bytes", length); 136 135 return false; 137 136 } … … 156 155 AMF_CHECK_BOUNDARIES(buffer, 1); 157 156 if (GETIBPOINTER(buffer)[0] != AMF0_NUMBER) { 158 FATAL("AMF type not valid: want: % hhu; got: %hhu",157 FATAL("AMF type not valid: want: %"PRIu8"; got: %"PRIu8, 159 158 AMF0_NUMBER, GETIBPOINTER(buffer)[0]); 160 159 return false; … … 195 194 AMF_CHECK_BOUNDARIES(buffer, 1); 196 195 if (GETIBPOINTER(buffer)[0] != AMF0_OBJECT) { 197 FATAL("AMF type not valid: want: % hhu; got: %hhu",196 FATAL("AMF type not valid: want: %"PRIu8"; got: %"PRIu8, 198 197 AMF0_OBJECT, GETIBPOINTER(buffer)[0]); 199 198 return false; … … 294 293 AMF_CHECK_BOUNDARIES(buffer, 1); 295 294 if (GETIBPOINTER(buffer)[0] != AMF0_MIXED_ARRAY) { 296 FATAL("AMF type not valid: want: % hhu; got: %hhu",295 FATAL("AMF type not valid: want: %"PRIu8"; got: %"PRIu8, 297 296 AMF0_MIXED_ARRAY, GETIBPOINTER(buffer)[0]); 298 297 return false; … … 404 403 405 404 bool AMF0Serializer::ReadArray(IOBuffer &buffer, Variant &variant, bool readType) { 406 407 405 if (readType) { 408 406 AMF_CHECK_BOUNDARIES(buffer, 1); 409 407 if (GETIBPOINTER(buffer)[0] != AMF0_ARRAY) { 410 FATAL("AMF type not valid: want: % hhu; got: %hhu",408 FATAL("AMF type not valid: want: %"PRIu8"; got: %"PRIu8, 411 409 AMF0_ARRAY, GETIBPOINTER(buffer)[0]); 412 410 return false; … … 450 448 AMF_CHECK_BOUNDARIES(buffer, 1); 451 449 if (GETIBPOINTER(buffer)[0] != AMF0_AMF3_OBJECT) { 452 FATAL("AMF type not valid: want: % hhu; got: %hhu",450 FATAL("AMF type not valid: want: %"PRIu8"; got: %"PRIu8, 453 451 AMF0_AMF3_OBJECT, GETIBPOINTER(buffer)[0]); 454 452 return false; … … 486 484 AMF_CHECK_BOUNDARIES(buffer, 1); 487 485 if (GETIBPOINTER(buffer)[0] != AMF0_BOOLEAN) { 488 FATAL("AMF type not valid: want: % hhu; got: %hhu",486 FATAL("AMF type not valid: want: %"PRIu8"; got: %"PRIu8, 489 487 AMF0_BOOLEAN, GETIBPOINTER(buffer)[0]); 490 488 return false; … … 524 522 AMF_CHECK_BOUNDARIES(buffer, 1); 525 523 if (GETIBPOINTER(buffer)[0] != AMF0_TIMESTAMP) { 526 FATAL("AMF type not valid: want: % hhu; got: %hhu",524 FATAL("AMF type not valid: want: %"PRIu8"; got: %"PRIu8, 527 525 AMF0_TIMESTAMP, GETIBPOINTER(buffer)[0]); 528 526 return false; … … 538 536 if (!ReadDouble(buffer, doubleVariant, false)) { 539 537 FATAL("Unable to read the value"); 538 return false; 540 539 } 541 540 … … 569 568 AMF_CHECK_BOUNDARIES(buffer, 1); 570 569 if (GETIBPOINTER(buffer)[0] != AMF0_NULL) { 571 FATAL("AMF type not valid: want: % hhu; got: %hhu",570 FATAL("AMF type not valid: want: %"PRIu8"; got: %"PRIu8, 572 571 AMF0_NULL, GETIBPOINTER(buffer)[0]); 573 572 return false; … … 592 591 AMF_CHECK_BOUNDARIES(buffer, 1); 593 592 if (GETIBPOINTER(buffer)[0] != AMF0_UNDEFINED) { 594 FATAL("AMF type not valid: want: % hhu; got: %hhu",593 FATAL("AMF type not valid: want: %"PRIu8"; got: %"PRIu8, 595 594 AMF0_UNDEFINED, GETIBPOINTER(buffer)[0]); 596 595 return false; … … 728 727 default: 729 728 { 730 FATAL("Unable to de-serialize type % hhu; Buffer: %s",729 FATAL("Unable to de-serialize type %"PRIu8"; Buffer: %s", 731 730 GETIBPOINTER(buffer)[0], STR(buffer)); 732 731 return false; -
trunk/sources/thelib/src/protocols/rtmp/basertmpprotocol.cpp
r650 r693 668 668 } 669 669 670 if (_selectedChannel >= MAX_CHANNELS_COUNT) { 671 FATAL("Bogus connection. Drop it like is hot"); 672 return false; 673 } 674 670 675 Channel &channel = _channels[_selectedChannel]; 671 676 Header &header = channel.lastInHeader; -
trunk/sources/thelib/src/protocols/rtmp/rtmpprotocolserializer.cpp
r467 r693 21 21 #include "protocols/rtmp/rtmpprotocolserializer.h" 22 22 #include "protocols/rtmp/messagefactories/messagefactories.h" 23 #include "protocols/rtmp/amftypes.h" 23 24 24 25 RTMPProtocolSerializer::RTMPProtocolSerializer() { 25 26 27 26 } 28 27 29 28 RTMPProtocolSerializer::~RTMPProtocolSerializer() { 30 31 29 } 32 30 … … 453 451 uint32_t length = buffer.GetCurrentWritePosition() 454 452 - rawLengthPosition - 4; 455 EHTONLP(buffer.GetPointer() + rawLengthPosition, length);453 EHTONLP(buffer.GetPointer() + rawLengthPosition, length); 456 454 break; 457 455 } … … 511 509 512 510 bool RTMPProtocolSerializer::DeserializeFlexStreamSend(IOBuffer &buffer, Variant &message) { 513 if (GETAVAILABLEBYTESCOUNT(buffer) < 1) { 514 FATAL("Incorrect buffer:\n%s", STR(buffer)); 515 return false; 516 } 517 511 AMF_CHECK_BOUNDARIES(buffer, 1); 518 512 message[RM_FLEXSTREAMSEND_UNKNOWNBYTE] = (uint8_t) GETIBPOINTER(buffer)[0]; 519 520 513 if (!buffer.Ignore(1)) { 521 514 FATAL("Unable to ignore 1 byte"); … … 563 556 bool RTMPProtocolSerializer::DeserializeAck(IOBuffer &buffer, 564 557 Variant &message) { 558 AMF_CHECK_BOUNDARIES(buffer, 4); 565 559 message = (uint32_t) ENTOHLP(GETIBPOINTER(buffer)); //----MARKED-LONG--- 566 560 return buffer.Ignore(4); … … 568 562 569 563 bool RTMPProtocolSerializer::DeserializeUsrCtrl(IOBuffer &buffer, Variant &message) { 564 AMF_CHECK_BOUNDARIES(buffer, 2); 570 565 message[RM_USRCTRL_TYPE] = ENTOHSP(GETIBPOINTER(buffer)); //----MARKED-SHORT---- 571 566 message[RM_USRCTRL_TYPE_STRING] = GetUserCtrlTypeString(message[RM_USRCTRL_TYPE]); … … 581 576 case RM_USRCTRL_TYPE_STREAM_IS_RECORDED: 582 577 { 578 AMF_CHECK_BOUNDARIES(buffer, 4); 583 579 message[RM_USRCTRL_STREAMID] = ENTOHLP(GETIBPOINTER(buffer)); //----MARKED-LONG--- 584 580 if (!buffer.Ignore(4)) { … … 590 586 case RM_USRCTRL_TYPE_STREAM_SET_BUFFER_LENGTH: 591 587 { 588 AMF_CHECK_BOUNDARIES(buffer, 8); 592 589 message[RM_USRCTRL_STREAMID] = ENTOHLP(GETIBPOINTER(buffer)); //----MARKED-LONG--- 593 590 if (!buffer.Ignore(4)) { … … 604 601 case RM_USRCTRL_TYPE_PING_REQUEST: 605 602 { 603 AMF_CHECK_BOUNDARIES(buffer, 4); 606 604 message[RM_USRCTRL_PING] = ENTOHLP(GETIBPOINTER(buffer)); //----MARKED-LONG--- 607 605 if (!buffer.Ignore(4)) { … … 613 611 case RM_USRCTRL_TYPE_PING_RESPONSE: 614 612 { 613 AMF_CHECK_BOUNDARIES(buffer, 4); 615 614 message[RM_USRCTRL_PONG] = ENTOHLP(GETIBPOINTER(buffer)); //----MARKED-LONG--- 616 615 if (!buffer.Ignore(4)) { … … 623 622 case RM_USRCTRL_TYPE_UNKNOWN2: 624 623 { 624 AMF_CHECK_BOUNDARIES(buffer, 4); 625 625 message[RM_USRCTRL_UNKNOWN_U32] = ENTOHLP(GETIBPOINTER(buffer)); //----MARKED-LONG--- 626 626 if (!buffer.Ignore(4)) { … … 641 641 bool RTMPProtocolSerializer::DeserializeChunkSize(IOBuffer &buffer, 642 642 Variant &message) { 643 AMF_CHECK_BOUNDARIES(buffer, 4); 643 644 message = (uint32_t) ENTOHLP(GETIBPOINTER(buffer)); //----MARKED-LONG--- 644 645 return buffer.Ignore(4); … … 646 647 647 648 bool RTMPProtocolSerializer::DeserializeWinAckSize(IOBuffer &buffer, Variant &message) { 649 AMF_CHECK_BOUNDARIES(buffer, 4); 648 650 message = (uint32_t) ENTOHLP(GETIBPOINTER(buffer)); //----MARKED-LONG--- 649 651 return buffer.Ignore(4); … … 651 653 652 654 bool RTMPProtocolSerializer::DeserializePeerBW(IOBuffer &buffer, Variant &message) { 655 AMF_CHECK_BOUNDARIES(buffer, 4); 653 656 message[RM_PEERBW_VALUE] = (uint32_t) ENTOHLP(GETIBPOINTER(buffer)); //----MARKED-LONG--- 654 657 if (!buffer.Ignore(4)) { … … 661 664 662 665 bool RTMPProtocolSerializer::DeserializeAbortMessage(IOBuffer &buffer, Variant &message) { 666 AMF_CHECK_BOUNDARIES(buffer, 4); 663 667 message = (uint32_t) ENTOHLP(GETIBPOINTER(buffer)); //----MARKED-LONG--- 664 668 if (!buffer.Ignore(4)) { … … 671 675 bool RTMPProtocolSerializer::DeserializeFlexSharedObject(IOBuffer &buffer, 672 676 Variant &message) { 677 AMF_CHECK_BOUNDARIES(buffer, 1); 673 678 if (GETIBPOINTER(buffer)[0] != 0) { 674 FATAL("Encoding % hhunot supported yet", GETIBPOINTER(buffer)[0]);679 FATAL("Encoding %"PRIu8" not supported yet", GETIBPOINTER(buffer)[0]); 675 680 return false; 676 681 } … … 706 711 707 712 //4. Skip 4 unknown bytes 713 AMF_CHECK_BOUNDARIES(buffer, 4); 708 714 if (!buffer.Ignore(4)) { 709 715 FATAL("Unable to ignore 4 bytes"); … … 731 737 } 732 738 uint32_t rawLength = primitive[RM_SHAREDOBJECTPRIMITIVE_RAWLENGTH]; 733 if (GETAVAILABLEBYTESCOUNT(buffer) < rawLength) { 734 FATAL("Not enough data to parse a SO primitive"); 735 return false; 736 } 739 AMF_CHECK_BOUNDARIES(buffer, rawLength); 737 740 738 741 //8. Read the rest of the primitive based on it's type
Note: See TracChangeset
for help on using the changeset viewer.
