> On Dec 29, 2017, at 3:59 PM, Carl Eugen Hoyos <ceffm...@gmail.com> wrote: > > 2017-12-29 19:12 GMT+01:00 Devin Heitmueller <dheitmuel...@ltnglobal.com>: > >> + uint8_t *outbuf = NULL; > >> + if (st->codecpar->codec_id == AV_CODEC_ID_AC3) >> + av_free(outbuf); > > The "if()" should not be necessary, free() and av_free() > may be called with argument "NULL”.
We don’t want to call av_free() if outbuf points to the original pkt->data field (i.e. if we’re receiving PCM audio). We only want to free the memory if we allocated new memory to hold the S337 packet. The concern isn’t the notion of calling av_free() if outbuf is NULL. It’s about calling av_free() if outbuf points to pkt->data. In short, I believe the logic here is correct. Devin _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel