On 09/24/2011 01:42 AM, Luca Barbato wrote:
> On 9/24/11 5:11 AM, Justin Ruggles wrote:
>> ---
>> libavcodec/utils.c | 2 +-
>> 1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/libavcodec/utils.c b/libavcodec/utils.c
>> index 9f198cb..c604819 100644
>> --- a/libavcodec/utils.c
>> +++ b/libavcodec/utils.c
>> @@ -747,7 +747,7 @@ int attribute_align_arg
>> avcodec_decode_audio3(AVCodecContext *avctx, int16_t *sa
>>
>> avctx->pkt = avpkt;
>>
>> - if((avctx->codec->capabilities& CODEC_CAP_DELAY) || avpkt->size){
>> + if ((avctx->codec->capabilities& CODEC_CAP_DELAY) || (avpkt->data&&
>> avpkt->size)) {
>> //FIXME remove the check below _after_ ensuring that all audio
>> check that the available space is enough
>> if(*frame_size_ptr< AVCODEC_MAX_AUDIO_FRAME_SIZE){
>> av_log(avctx, AV_LOG_ERROR, "buffer smaller than
>> AVCODEC_MAX_AUDIO_FRAME_SIZE\n");
>
> when a packet could have a size !=0 and data == NULL ? I'd error out
> over the condition.
Sounds good. The avcodec_decode_video2() documentation is clear that the
empty packets for CODEC_CAP_DELAY must have data=NULL,size=0. But the
documentation for CODEC_CAP_DELAY just says "fed with NULL"..nothing
about the size.
I'll send 2 new patches later today. One to error out on
data=NULL,size!=0 and another to clarify the documentation.
Thanks,
Justin
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel