mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-29 22:00:58 +02:00
Merge remote-tracking branch 'qatar/master'
* qatar/master: configure: suppress -fPIC in msvc builds Drop unnecessary 'l' length modifier when printfing double values. truemotion2: Sanitize tm2_read_header() Conflicts: libavcodec/truemotion2.c libavfilter/src_movie.c libavutil/opt.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
commit
08196c785a
1
configure
vendored
1
configure
vendored
@ -2448,6 +2448,7 @@ msvc_flags(){
|
|||||||
-fno-math-errno) ;;
|
-fno-math-errno) ;;
|
||||||
-fno-common) ;;
|
-fno-common) ;;
|
||||||
-fno-signed-zeros) ;;
|
-fno-signed-zeros) ;;
|
||||||
|
-fPIC) ;;
|
||||||
-lz) echo zlib.lib ;;
|
-lz) echo zlib.lib ;;
|
||||||
-lavifil32) echo vfw32.lib ;;
|
-lavifil32) echo vfw32.lib ;;
|
||||||
-lavicap32) echo vfw32.lib user32.lib ;;
|
-lavicap32) echo vfw32.lib user32.lib ;;
|
||||||
|
@ -205,21 +205,22 @@ static inline int tm2_get_token(GetBitContext *gb, TM2Codes *code)
|
|||||||
return code->recode[val];
|
return code->recode[val];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define TM2_OLD_HEADER_MAGIC 0x00000100
|
||||||
|
#define TM2_NEW_HEADER_MAGIC 0x00000101
|
||||||
|
|
||||||
static inline int tm2_read_header(TM2Context *ctx, const uint8_t *buf)
|
static inline int tm2_read_header(TM2Context *ctx, const uint8_t *buf)
|
||||||
{
|
{
|
||||||
uint32_t magic;
|
uint32_t magic = AV_RL32(buf);
|
||||||
|
|
||||||
magic = AV_RL32(buf);
|
switch (magic) {
|
||||||
buf += 4;
|
case TM2_OLD_HEADER_MAGIC:
|
||||||
|
|
||||||
if(magic == 0x00000100) { /* old header */
|
|
||||||
av_log_missing_feature(ctx->avctx, "TM2 old header", 1);
|
av_log_missing_feature(ctx->avctx, "TM2 old header", 1);
|
||||||
return 40;
|
return 0;
|
||||||
} else if(magic == 0x00000101) { /* new header */
|
case TM2_NEW_HEADER_MAGIC:
|
||||||
return 40;
|
return 0;
|
||||||
} else {
|
default:
|
||||||
av_log (ctx->avctx, AV_LOG_ERROR, "Not a TM2 header: 0x%08X\n", magic);
|
av_log(ctx->avctx, AV_LOG_ERROR, "Not a TM2 header: 0x%08X\n", magic);
|
||||||
return -1;
|
return AVERROR_INVALIDDATA;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -825,6 +826,8 @@ static const int tm2_stream_order[TM2_NUM_STREAMS] = {
|
|||||||
TM2_C_HI, TM2_C_LO, TM2_L_HI, TM2_L_LO, TM2_UPD, TM2_MOT, TM2_TYPE
|
TM2_C_HI, TM2_C_LO, TM2_L_HI, TM2_L_LO, TM2_UPD, TM2_MOT, TM2_TYPE
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#define TM2_HEADER_SIZE 40
|
||||||
|
|
||||||
static int decode_frame(AVCodecContext *avctx,
|
static int decode_frame(AVCodecContext *avctx,
|
||||||
void *data, int *got_frame,
|
void *data, int *got_frame,
|
||||||
AVPacket *avpkt)
|
AVPacket *avpkt)
|
||||||
@ -833,7 +836,7 @@ static int decode_frame(AVCodecContext *avctx,
|
|||||||
int buf_size = avpkt->size & ~3;
|
int buf_size = avpkt->size & ~3;
|
||||||
TM2Context * const l = avctx->priv_data;
|
TM2Context * const l = avctx->priv_data;
|
||||||
AVFrame * const p = &l->pic;
|
AVFrame * const p = &l->pic;
|
||||||
int i, ret, skip, t;
|
int i, offset = TM2_HEADER_SIZE, t, ret;
|
||||||
|
|
||||||
av_fast_padded_malloc(&l->buffer, &l->buffer_size, buf_size);
|
av_fast_padded_malloc(&l->buffer, &l->buffer_size, buf_size);
|
||||||
if(!l->buffer){
|
if(!l->buffer){
|
||||||
@ -848,23 +851,23 @@ static int decode_frame(AVCodecContext *avctx,
|
|||||||
}
|
}
|
||||||
|
|
||||||
l->dsp.bswap_buf((uint32_t*)l->buffer, (const uint32_t*)buf, buf_size >> 2);
|
l->dsp.bswap_buf((uint32_t*)l->buffer, (const uint32_t*)buf, buf_size >> 2);
|
||||||
skip = tm2_read_header(l, l->buffer);
|
|
||||||
|
|
||||||
if(skip == -1){
|
if ((ret = tm2_read_header(l, l->buffer)) < 0) {
|
||||||
return AVERROR_INVALIDDATA;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
for(i = 0; i < TM2_NUM_STREAMS; i++){
|
for(i = 0; i < TM2_NUM_STREAMS; i++){
|
||||||
if (skip >= buf_size) {
|
if (offset >= buf_size) {
|
||||||
av_log(avctx, AV_LOG_ERROR, "no space for tm2_read_stream\n");
|
av_log(avctx, AV_LOG_ERROR, "no space for tm2_read_stream\n");
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
}
|
}
|
||||||
|
|
||||||
t = tm2_read_stream(l, l->buffer + skip, tm2_stream_order[i], buf_size - skip);
|
t = tm2_read_stream(l, l->buffer + offset, tm2_stream_order[i],
|
||||||
|
buf_size - offset);
|
||||||
if(t < 0){
|
if(t < 0){
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
skip += t;
|
offset += t;
|
||||||
}
|
}
|
||||||
p->key_frame = tm2_decode_blocks(l, p);
|
p->key_frame = tm2_decode_blocks(l, p);
|
||||||
if(p->key_frame)
|
if(p->key_frame)
|
||||||
|
@ -189,7 +189,7 @@ static int set_params(AVFilterContext *ctx, const char *params)
|
|||||||
case F0R_PARAM_POSITION:
|
case F0R_PARAM_POSITION:
|
||||||
v = &pos;
|
v = &pos;
|
||||||
frei0r->get_param_value(frei0r->instance, v, i);
|
frei0r->get_param_value(frei0r->instance, v, i);
|
||||||
av_log(ctx, AV_LOG_DEBUG, "%lf/%lf", pos.x, pos.y);
|
av_log(ctx, AV_LOG_DEBUG, "%f/%f", pos.x, pos.y);
|
||||||
break;
|
break;
|
||||||
default: /* F0R_PARAM_STRING */
|
default: /* F0R_PARAM_STRING */
|
||||||
v = s;
|
v = s;
|
||||||
|
@ -235,7 +235,7 @@ static int init(AVFilterContext *ctx, const char *args)
|
|||||||
hqdn3d->strength[2] = chrom_spac;
|
hqdn3d->strength[2] = chrom_spac;
|
||||||
hqdn3d->strength[3] = chrom_tmp;
|
hqdn3d->strength[3] = chrom_tmp;
|
||||||
|
|
||||||
av_log(ctx, AV_LOG_VERBOSE, "ls:%lf cs:%lf lt:%lf ct:%lf\n",
|
av_log(ctx, AV_LOG_VERBOSE, "ls:%f cs:%f lt:%f ct:%f\n",
|
||||||
lum_spac, chrom_spac, lum_tmp, chrom_tmp);
|
lum_spac, chrom_spac, lum_tmp, chrom_tmp);
|
||||||
if (lum_spac < 0 || chrom_spac < 0 || isnan(chrom_tmp)) {
|
if (lum_spac < 0 || chrom_spac < 0 || isnan(chrom_tmp)) {
|
||||||
av_log(ctx, AV_LOG_ERROR,
|
av_log(ctx, AV_LOG_ERROR,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user