Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-02-29 03:30:35 +0400
committerMichael Niedermayer <michaelni@gmx.at>2012-02-29 03:30:35 +0400
commit0e6aa0fef565fdb625673c60276e90c2ea091e8e (patch)
treef0b08a7f4b465aaa0d9144e9b837b18294db3df6 /libavcodec/adpcm.c
parentf929abd0c3643b28a9552512d698cf61ad4d08fa (diff)
parentbbeb29133b55b7256d18f5aaab8b5c8e919a173a (diff)
Merge remote-tracking branch 'qatar/master'
* qatar/master: adpcm: Clip step_index values read from the bitstream at the beginning of each frame. oma: don't read beyond end of leaf_table. doxygen: Remove documentation for non-existing parameters; misc small fixes. Indeo3: fix crashes on corrupt bitstreams. msmpeg4: Replace forward declaration by proper #include. segment: implement wrap around avf: reorder AVStream and AVFormatContext aacdec: Remove erroneous reference to global gain from the out of bounds scalefactor error message. Conflicts: libavcodec/indeo3.c libavformat/avformat.h libavutil/avutil.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/adpcm.c')
-rw-r--r--libavcodec/adpcm.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/libavcodec/adpcm.c b/libavcodec/adpcm.c
index 54c1dc6983..559eb293ce 100644
--- a/libavcodec/adpcm.c
+++ b/libavcodec/adpcm.c
@@ -707,7 +707,7 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data,
for (channel = 0; channel < avctx->channels; channel++) {
cs = &c->status[channel];
cs->predictor = (int16_t)bytestream_get_le16(&src);
- cs->step_index = *src++;
+ cs->step_index = av_clip(*src++, 0, 88);
src++;
*samples++ = cs->predictor;
}
@@ -730,8 +730,8 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data,
c->status[0].predictor = (int16_t)AV_RL16(src + 10);
c->status[1].predictor = (int16_t)AV_RL16(src + 12);
- c->status[0].step_index = src[14];
- c->status[1].step_index = src[15];
+ c->status[0].step_index = av_clip(src[14], 0, 88);
+ c->status[1].step_index = av_clip(src[15], 0, 88);
/* sign extend the predictors */
src += 16;
diff_channel = c->status[1].predictor;
@@ -771,7 +771,7 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data,
for (channel = 0; channel < avctx->channels; channel++) {
cs = &c->status[channel];
cs->predictor = (int16_t)bytestream_get_le16(&src);
- cs->step_index = *src++;
+ cs->step_index = av_clip(*src++, 0, 88);
src++;
}
@@ -834,7 +834,7 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data,
src += 4; // skip sample count (already read)
for (i=0; i<=st; i++)
- c->status[i].step_index = bytestream_get_le32(&src);
+ c->status[i].step_index = av_clip(bytestream_get_le32(&src), 0, 88);
for (i=0; i<=st; i++)
c->status[i].predictor = bytestream_get_le32(&src);
@@ -1051,11 +1051,11 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data,
case CODEC_ID_ADPCM_IMA_SMJPEG:
if (avctx->codec->id == CODEC_ID_ADPCM_IMA_AMV) {
c->status[0].predictor = sign_extend(bytestream_get_le16(&src), 16);
- c->status[0].step_index = bytestream_get_le16(&src);
+ c->status[0].step_index = av_clip(bytestream_get_le16(&src), 0, 88);
src += 4;
} else {
c->status[0].predictor = sign_extend(bytestream_get_be16(&src), 16);
- c->status[0].step_index = bytestream_get_byte(&src);
+ c->status[0].step_index = av_clip(bytestream_get_byte(&src), 0, 88);
src += 1;
}