mediastreamer2 icon indicating copy to clipboard operation
mediastreamer2 copied to clipboard

[Bug]: Possible problem in msgenericplc.c

Open Pilyushkin opened this issue 2 years ago • 0 comments

Context

Learning to work with RTP protocol

General information

  • Device: PC
  • OS: Ubuntu 20.04
  • Version of the App:
  • Version of the SDK: mediastreamer2-5.1.12

Expected behaviour

I wrote an additional filter for forwarding media data to the media streamer chain from the application. When testing, I pass data from the file through my filter to the media streamer chain. When the file is finished reading, a media packet less than 320 bytes in size is passed to the chain. A plc filter is included in the media processing chain. In this filter, a memory access error occurs on line 96 (msgenericplc.c)

if (plc_context->plc_samples_used!=0) {
    /*we were doing PLC, now resuming with normal audio, continuity buffer is twice the transition delay lengths,  the second half is untouched by the update function and contains transition data generated by PLC */
   generic_plc_transition_mix((int16_t *) (m->b_rptr+transitionBufferSize), (int16_t *) (plc_context->continuity_buffer+transitionBufferSize), mgps->rate*TRANSITION_DELAY/1000);
}

This is due to a shift in the data buffer by an amount greater than the size of the buffer, or by an amount that, together with the size mgps->rate*TRANSITION_DELAY/1000, exceeds the length of the buffer.

I would like to know if this is an error in the logic in the plc module, or should I check the size of the media frame at the application level before sending it?

To Reproduce

Send a media frame less than 120 bytes to the PLC filter

Additional context

Add any other context about the problem here.

SDK logs URL

No response

Pilyushkin avatar Jul 21 '22 14:07 Pilyushkin