[Libav-user] Problem in setting stream side data

Carl Eugen Hoyos ceffmpeg at gmail.com
Fri Jan 19 14:11:46 EET 2018


2018-01-19 12:59 GMT+01:00 Davood Falahati <falahati.davood at gmail.com>:
>                 uint8_t* resp=(uint8_t*)
> av_mallocz(in_stream->side_data->size+AV_INPUT_BUFFER_MIN_SIZE);

The cast is unneeded in a C file, the allocation seems to leak.

>                 resp  = av_stream_get_side_data(in_stream ,
> AV_PKT_DATA_DISPLAYMATRIX, sd_size);
>
>                 in_stream->side_data->data = (uint8_t*) av_mallocz(
>                               in_stream->side_data->size*sizeof(uint8_t*)
>                               );

Possibly unneeded cast and you should check all
allocations for success.

Carl Eugen


More information about the Libav-user mailing list