Loading media/libmediametrics/include/media/MediaMetricsItem.h +6 −5 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ #include <variant> #include <binder/Parcel.h> #include <log/log.h> #include <utils/Errors.h> #include <utils/Timers.h> // nsecs_t Loading Loading @@ -469,16 +470,16 @@ protected: template <> // static status_t extract(std::string *val, const char **bufferpptr, const char *bufferptrmax) { const char *ptr = *bufferpptr; while (*ptr != 0) { do { if (ptr >= bufferptrmax) { ALOGE("%s: buffer exceeded", __func__); android_errorWriteLog(0x534e4554, "204445255"); return BAD_VALUE; } ++ptr; } const size_t size = (ptr - *bufferpptr) + 1; } while (*ptr++ != 0); // ptr is terminator+1, == bufferptrmax if we finished entire buffer *val = *bufferpptr; *bufferpptr += size; *bufferpptr = ptr; return NO_ERROR; } template <> // static Loading media/libstagefright/rtsp/AAVCAssembler.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -295,6 +295,10 @@ ARTPAssembler::AssemblyStatus AAVCAssembler::addNALUnit( } void AAVCAssembler::checkSpsUpdated(const sp<ABuffer> &buffer) { if (buffer->size() == 0) { android_errorWriteLog(0x534e4554, "204077881"); return; } const uint8_t *data = buffer->data(); unsigned nalType = data[0] & 0x1f; if (nalType == 0x7) { Loading Loading
media/libmediametrics/include/media/MediaMetricsItem.h +6 −5 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ #include <variant> #include <binder/Parcel.h> #include <log/log.h> #include <utils/Errors.h> #include <utils/Timers.h> // nsecs_t Loading Loading @@ -469,16 +470,16 @@ protected: template <> // static status_t extract(std::string *val, const char **bufferpptr, const char *bufferptrmax) { const char *ptr = *bufferpptr; while (*ptr != 0) { do { if (ptr >= bufferptrmax) { ALOGE("%s: buffer exceeded", __func__); android_errorWriteLog(0x534e4554, "204445255"); return BAD_VALUE; } ++ptr; } const size_t size = (ptr - *bufferpptr) + 1; } while (*ptr++ != 0); // ptr is terminator+1, == bufferptrmax if we finished entire buffer *val = *bufferpptr; *bufferpptr += size; *bufferpptr = ptr; return NO_ERROR; } template <> // static Loading
media/libstagefright/rtsp/AAVCAssembler.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -295,6 +295,10 @@ ARTPAssembler::AssemblyStatus AAVCAssembler::addNALUnit( } void AAVCAssembler::checkSpsUpdated(const sp<ABuffer> &buffer) { if (buffer->size() == 0) { android_errorWriteLog(0x534e4554, "204077881"); return; } const uint8_t *data = buffer->data(); unsigned nalType = data[0] & 0x1f; if (nalType == 0x7) { Loading