On 06/02/15 6:15 AM, Carl Eugen Hoyos wrote:
> -    crc = ffio_get_checksum(s->pb) ^ UINT32_MAX;
> -    if (crc != avio_rl32(s->pb) && s->error_recognition & AV_EF_CRCCHECK) {
> -        av_log(s, AV_LOG_ERROR, "Header CRC error\n");
> -        return AVERROR_INVALIDDATA;
> +    if (s->error_recognition & AV_EF_CRCCHECK) {
> +        crc = ffio_get_checksum(s->pb) ^ UINT32_MAX;
> +        if (crc != avio_rl32(s->pb) && s->error_recognition & 
> AV_EF_CRCCHECK) {
> +            av_log(s, AV_LOG_ERROR, "Header CRC error\n");
> +            return AVERROR_INVALIDDATA;
> +        }

This is skipping avio_rl32() and not updating the pb pointer when crc is not 
checked, which 
is the same trap i feel into the first time.

Nonetheless, i didn't go with something like the above to keep it simple and 
because this is 
done when demuxing the header, which is extremely small and read only once 
anyway.
This is certainly no bottleneck.
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

Reply via email to