额外的字节阻止什么

额外的字节阻止什么

本文介绍了avcodec_decode_video2:额外的字节阻止什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!

在的文档中,它提供以下警告:

In the documentation for avcodec_decode_video2 it gives the following warning:

输入缓冲区必须大于
实际值为FF_INPUT_BUFFER_PADDING_SIZE读取字节,因为一些优化的比特流
读取器一次读取32或64位,并且可以读取结束。输入缓冲区buf的
结束应设置为0,以确保损坏的MPEG流不会发生
超程。

The input buffer must be FF_INPUT_BUFFER_PADDING_SIZE larger than the actual read bytes because some optimized bitstream readers read 32 or 64 bits at once and could read over the end. The end of the input buffer buf should be set to 0 to ensure that no overreading happens for damaged MPEG streams.

如果没有实现,这会在重写过程中造成分段错误?还是可能会造成怪异的腐败?我只是好奇,因为我有腐败,我不知道这是否可能导致我的问题。

If this were not implemented would this cause segmentation faults when overreading occurs? Or would it potentially cause weird corruption? I'm just curious as I have corruption and I'm not sure if this could potentially be causing my problem.

推荐答案

它不一定会导致分段错误,但它将是未定义的行为,因为这些读者将会读取未分配的内存。这可能会使程序立即崩溃,或者工作一段时间,甚至似乎工作正常:您无法确定何时涉及未定义的行为

It wouldn't necessarily cause segmentation faults, but it would be undefined behavior, since these readers would be reading unallocated memory. This could make the program crash immediately, or work for a while, or even appear to work fine: you can never be sure when it comes to undefined behavior.

这篇关于avcodec_decode_video2:额外的字节阻止什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-06 17:23