Compare commits

...

4 Commits

Author SHA1 Message Date
7371b0ca6f 0.7.3
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-08-10 13:59:49 +02:00
c5cbda5079 cavs: fix oCERT #2011-002 FFmpeg/libavcodec insufficient boundary check
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-08-10 13:59:15 +02:00
8893f7d815 Fix possible crash when decoding mpeg streams.
This reverts 2cf8355f98,
fixes ticket 329.
2011-08-04 11:43:34 +02:00
7c772ccd27 Bink: clip AC coefficients during dequantization.
Fixes artefacts with Neverwinter Nights WOTCLogo.bik
(http://drmccoy.de/zeugs/WOTCLogo.bik).
Fixes trac ticket #352.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
(cherry picked from commit 47b71eea09)
2011-08-04 11:42:33 +02:00
6 changed files with 27 additions and 8 deletions

View File

@ -31,7 +31,7 @@ PROJECT_NAME = FFmpeg
# This could be handy for archiving the generated documentation or
# if some version control system is used.
PROJECT_NUMBER = 0.8.1
PROJECT_NUMBER = 0.7.3
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
# base path where the generated documentation will be put.

View File

@ -1 +1 @@
0.7.2
0.7.3

View File

@ -1 +1 @@
0.7.2
0.7.3

View File

@ -345,6 +345,7 @@ typedef struct AVInputFile {
int eof_reached; /* true if eof reached */
int ist_index; /* index of first stream in ist_table */
int buffer_size; /* current total buffer size */
int nb_streams;
} AVInputFile;
#if HAVE_TERMIOS_H
@ -2046,7 +2047,7 @@ static int transcode(AVFormatContext **output_files,
int si = stream_maps[i].stream_index;
if (fi < 0 || fi > nb_input_files - 1 ||
si < 0 || si > input_files[fi].ctx->nb_streams - 1) {
si < 0 || si > input_files[fi].nb_streams - 1) {
fprintf(stderr,"Could not find input stream #%d.%d\n", fi, si);
ret = AVERROR(EINVAL);
goto fail;
@ -2732,7 +2733,7 @@ static int transcode(AVFormatContext **output_files,
}
/* the following test is needed in case new streams appear
dynamically in stream : we ignore them */
if (pkt.stream_index >= input_files[file_index].ctx->nb_streams)
if (pkt.stream_index >= input_files[file_index].nb_streams)
goto discard_packet;
ist_index = input_files[file_index].ist_index + pkt.stream_index;
ist = &input_streams[ist_index];
@ -3469,6 +3470,7 @@ static int opt_input_file(const char *opt, const char *filename)
input_files = grow_array(input_files, sizeof(*input_files), &nb_input_files, nb_input_files + 1);
input_files[nb_input_files - 1].ctx = ic;
input_files[nb_input_files - 1].ist_index = nb_input_streams - ic->nb_streams;
input_files[nb_input_files - 1].nb_streams = ic->nb_streams;
top_field_first = -1;
video_channel = 0;

View File

@ -571,6 +571,22 @@ static inline int binkb_get_value(BinkContext *c, int bundle_num)
return ret;
}
static inline DCTELEM dequant(DCTELEM in, uint32_t quant, int dc)
{
/* Note: multiplication is unsigned but we want signed shift
* otherwise clipping breaks.
* TODO: The official decoder does not use clipping at all
* but instead uses the full 32-bit result.
* However clipping at least gets rid of the case that a
* half-black half-white intra block gets black and white swapped
* and should cause at most minor differences (except for DC). */
int32_t res = in * quant;
res >>= 11;
if (!dc)
res = av_clip_int16(res);
return res;
}
/**
* Read 8x8 block of DCT coefficients.
*
@ -669,10 +685,10 @@ static int read_dct_coeffs(GetBitContext *gb, DCTELEM block[64], const uint8_t *
quant = quant_matrices[quant_idx];
block[0] = (block[0] * quant[0]) >> 11;
block[0] = dequant(block[0], quant[0], 1);
for (i = 0; i < coef_count; i++) {
int idx = coef_idx[i];
block[scan[idx]] = (block[scan[idx]] * quant[idx]) >> 11;
block[scan[idx]] = dequant(block[scan[idx]], quant[idx], 0);
}
return 0;

View File

@ -115,7 +115,8 @@ static inline int get_ue_code(GetBitContext *gb, int order) {
static int decode_residual_block(AVSContext *h, GetBitContext *gb,
const struct dec_2dvlc *r, int esc_golomb_order,
int qp, uint8_t *dst, int stride) {
int i, level_code, esc_code, level, run, mask;
int i, esc_code, level, mask;
unsigned int level_code, run;
DCTELEM level_buf[65];
uint8_t run_buf[65];
DCTELEM *block = h->block;