On 09/25/2011 05:04 PM, Måns Rullgård wrote: > Justin Ruggles <[email protected]> writes: > >> This also prevents NULL packets from being sent to the decoder unless >> CODEC_CAP_DELAY is set. >> --- >> libavcodec/utils.c | 5 +++++ >> 1 files changed, 5 insertions(+), 0 deletions(-) >> >> diff --git a/libavcodec/utils.c b/libavcodec/utils.c >> index 8459e5f..85c9d76 100644 >> --- a/libavcodec/utils.c >> +++ b/libavcodec/utils.c >> @@ -747,6 +747,11 @@ int attribute_align_arg >> avcodec_decode_audio3(AVCodecContext *avctx, int16_t *sa >> >> avctx->pkt = avpkt; >> >> + if (!avpkt->data && avpkt->size) { >> + av_log(avctx, AV_LOG_ERROR, "invalid packet: NULL data, size > >> 0\n"); >> + return AVERROR(EINVAL); >> + } > > Why? If someone does this, do they deserve anything better than a crash?
could help us find future bugs in tools and libavformat. at least it could be an assert. -Justin _______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
