diff options
author | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2012-09-15 18:22:21 +0200 |
---|---|---|
committer | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2012-09-23 15:40:17 +0200 |
commit | 3905caf25115f7728416e82b13deadd22ff2f19b (patch) | |
tree | 5f45f7796647875476c230fcc8b0bc73928ae831 /libavcodec/mpeg12.c | |
parent | 2599541b3d7367d70d30ba88f17295265daef579 (diff) | |
download | ffmpeg-3905caf25115f7728416e82b13deadd22ff2f19b.tar.gz |
Document that the MPEG12 "fast" functions can read out of bounds.
This is intentional (and a reason why fast usually should not be used),
but a few people sent patches to "fix" this recently so it would be
better to document this.
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
Diffstat (limited to 'libavcodec/mpeg12.c')
-rw-r--r-- | libavcodec/mpeg12.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c index 1bf857e5f4..1e7ff9cf6f 100644 --- a/libavcodec/mpeg12.c +++ b/libavcodec/mpeg12.c @@ -232,6 +232,11 @@ end: return 0; } +/** + * Note: this function can read out of range and crash for corrupt streams. + * Changing this would eat up any speed benefits it has. + * Do not use "fast" flag if you need the code to be robust. + */ static inline int mpeg1_fast_decode_block_inter(MpegEncContext *s, DCTELEM *block, int n) { int level, i, j, run; @@ -383,6 +388,11 @@ end: return 0; } +/** + * Note: this function can read out of range and crash for corrupt streams. + * Changing this would eat up any speed benefits it has. + * Do not use "fast" flag if you need the code to be robust. + */ static inline int mpeg2_fast_decode_block_non_intra(MpegEncContext *s, DCTELEM *block, int n) { @@ -523,6 +533,11 @@ static inline int mpeg2_decode_block_intra(MpegEncContext *s, DCTELEM *block, in return 0; } +/** + * Note: this function can read out of range and crash for corrupt streams. + * Changing this would eat up any speed benefits it has. + * Do not use "fast" flag if you need the code to be robust. + */ static inline int mpeg2_fast_decode_block_intra(MpegEncContext *s, DCTELEM *block, int n) { int level, dc, diff, j, run; |