Compare commits
15 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
a81f72e482 | ||
![]() |
24a0273cb8 | ||
![]() |
974c2ad87c | ||
![]() |
90c8fa5221 | ||
![]() |
43aae00455 | ||
![]() |
02ac859dfe | ||
![]() |
04fb6bb915 | ||
![]() |
b012da4019 | ||
![]() |
617a9eedc6 | ||
![]() |
e7484d5425 | ||
![]() |
31f9e849a8 | ||
![]() |
fde0b7d91c | ||
![]() |
b5f685211c | ||
![]() |
588571d41d | ||
![]() |
2abf5eeea6 |
@@ -50,7 +50,7 @@ AVCodecContext *avctx_opts[CODEC_TYPE_NB];
|
||||
AVFormatContext *avformat_opts;
|
||||
struct SwsContext *sws_opts;
|
||||
|
||||
const int this_year = 2013;
|
||||
const int this_year = 2014;
|
||||
|
||||
double parse_number_or_die(const char *context, const char *numstr, int type, double min, double max)
|
||||
{
|
||||
|
@@ -3497,7 +3497,7 @@ static void clear_blocks_c(DCTELEM *blocks)
|
||||
|
||||
static void add_bytes_c(uint8_t *dst, uint8_t *src, int w){
|
||||
long i;
|
||||
for(i=0; i<=w-sizeof(long); i+=sizeof(long)){
|
||||
for(i=0; i<=w-(int)sizeof(long); i+=sizeof(long)){
|
||||
long a = *(long*)(src+i);
|
||||
long b = *(long*)(dst+i);
|
||||
*(long*)(dst+i) = ((a&pb_7f) + (b&pb_7f)) ^ ((a^b)&pb_80);
|
||||
@@ -3508,7 +3508,7 @@ static void add_bytes_c(uint8_t *dst, uint8_t *src, int w){
|
||||
|
||||
static void add_bytes_l2_c(uint8_t *dst, uint8_t *src1, uint8_t *src2, int w){
|
||||
long i;
|
||||
for(i=0; i<=w-sizeof(long); i+=sizeof(long)){
|
||||
for(i=0; i<=w-(int)sizeof(long); i+=sizeof(long)){
|
||||
long a = *(long*)(src1+i);
|
||||
long b = *(long*)(src2+i);
|
||||
*(long*)(dst+i) = ((a&pb_7f) + (b&pb_7f)) ^ ((a^b)&pb_80);
|
||||
@@ -3533,7 +3533,7 @@ static void diff_bytes_c(uint8_t *dst, uint8_t *src1, uint8_t *src2, int w){
|
||||
}
|
||||
}else
|
||||
#endif
|
||||
for(i=0; i<=w-sizeof(long); i+=sizeof(long)){
|
||||
for(i=0; i<=w-(int)sizeof(long); i+=sizeof(long)){
|
||||
long a = *(long*)(src1+i);
|
||||
long b = *(long*)(src2+i);
|
||||
*(long*)(dst+i) = ((a|pb_80) - (b&pb_7f)) ^ ((a^b^pb_80)&pb_80);
|
||||
|
@@ -360,7 +360,7 @@ static inline int encode_line(FFV1Context *s, int w, int_fast16_t *sample[2], in
|
||||
int run_mode=0;
|
||||
|
||||
if(s->ac){
|
||||
if(c->bytestream_end - c->bytestream < w*20){
|
||||
if(c->bytestream_end - c->bytestream < w*35){
|
||||
av_log(s->avctx, AV_LOG_ERROR, "encoded frame too large\n");
|
||||
return -1;
|
||||
}
|
||||
|
@@ -143,6 +143,8 @@ static inline int ls_get_code_runterm(GetBitContext *gb, JLSState *state, int RI
|
||||
ret = ret >> 1;
|
||||
}
|
||||
|
||||
if(FFABS(ret) > 0xFFFF)
|
||||
return -0x10000;
|
||||
/* update state */
|
||||
state->A[Q] += FFABS(ret) - RItype;
|
||||
ret *= state->twonear;
|
||||
|
@@ -253,8 +253,10 @@ int ff_combine_frame(ParseContext *pc, int next, const uint8_t **buf, int *buf_s
|
||||
if(next == END_NOT_FOUND){
|
||||
void* new_buffer = av_fast_realloc(pc->buffer, &pc->buffer_size, (*buf_size) + pc->index + FF_INPUT_BUFFER_PADDING_SIZE);
|
||||
|
||||
if(!new_buffer)
|
||||
if(!new_buffer) {
|
||||
pc->index = 0;
|
||||
return AVERROR(ENOMEM);
|
||||
}
|
||||
pc->buffer = new_buffer;
|
||||
memcpy(&pc->buffer[pc->index], *buf, *buf_size);
|
||||
pc->index += *buf_size;
|
||||
@@ -267,9 +269,11 @@ int ff_combine_frame(ParseContext *pc, int next, const uint8_t **buf, int *buf_s
|
||||
/* append to buffer */
|
||||
if(pc->index){
|
||||
void* new_buffer = av_fast_realloc(pc->buffer, &pc->buffer_size, next + pc->index + FF_INPUT_BUFFER_PADDING_SIZE);
|
||||
|
||||
if(!new_buffer)
|
||||
if(!new_buffer) {
|
||||
pc->overread_index =
|
||||
pc->index = 0;
|
||||
return AVERROR(ENOMEM);
|
||||
}
|
||||
pc->buffer = new_buffer;
|
||||
memcpy(&pc->buffer[pc->index], *buf, next + FF_INPUT_BUFFER_PADDING_SIZE );
|
||||
pc->index = 0;
|
||||
|
@@ -84,7 +84,7 @@ static void rpza_decode_stream(RpzaContext *s)
|
||||
unsigned short *pixels = (unsigned short *)s->frame.data[0];
|
||||
|
||||
int row_ptr = 0;
|
||||
int pixel_ptr = 0;
|
||||
int pixel_ptr = -4;
|
||||
int block_ptr;
|
||||
int pixel_x, pixel_y;
|
||||
int total_blocks;
|
||||
@@ -140,6 +140,7 @@ static void rpza_decode_stream(RpzaContext *s)
|
||||
colorA = AV_RB16 (&s->buf[stream_ptr]);
|
||||
stream_ptr += 2;
|
||||
while (n_blocks--) {
|
||||
ADVANCE_BLOCK()
|
||||
block_ptr = row_ptr + pixel_ptr;
|
||||
for (pixel_y = 0; pixel_y < 4; pixel_y++) {
|
||||
for (pixel_x = 0; pixel_x < 4; pixel_x++){
|
||||
@@ -148,7 +149,6 @@ static void rpza_decode_stream(RpzaContext *s)
|
||||
}
|
||||
block_ptr += row_inc;
|
||||
}
|
||||
ADVANCE_BLOCK();
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -185,6 +185,7 @@ static void rpza_decode_stream(RpzaContext *s)
|
||||
color4[2] |= ((21 * ta + 11 * tb) >> 5);
|
||||
|
||||
while (n_blocks--) {
|
||||
ADVANCE_BLOCK();
|
||||
block_ptr = row_ptr + pixel_ptr;
|
||||
for (pixel_y = 0; pixel_y < 4; pixel_y++) {
|
||||
index = s->buf[stream_ptr++];
|
||||
@@ -195,12 +196,12 @@ static void rpza_decode_stream(RpzaContext *s)
|
||||
}
|
||||
block_ptr += row_inc;
|
||||
}
|
||||
ADVANCE_BLOCK();
|
||||
}
|
||||
break;
|
||||
|
||||
/* Fill block with 16 colors */
|
||||
case 0x00:
|
||||
ADVANCE_BLOCK();
|
||||
block_ptr = row_ptr + pixel_ptr;
|
||||
for (pixel_y = 0; pixel_y < 4; pixel_y++) {
|
||||
for (pixel_x = 0; pixel_x < 4; pixel_x++){
|
||||
@@ -214,7 +215,6 @@ static void rpza_decode_stream(RpzaContext *s)
|
||||
}
|
||||
block_ptr += row_inc;
|
||||
}
|
||||
ADVANCE_BLOCK();
|
||||
break;
|
||||
|
||||
/* Unknown opcode */
|
||||
|
@@ -275,6 +275,11 @@ static int decode_hextile(VmncContext *c, uint8_t* dst, const uint8_t* src, int
|
||||
}
|
||||
xy = *src++;
|
||||
wh = *src++;
|
||||
if ( (xy >> 4) + (wh >> 4) + 1 > w - i
|
||||
|| (xy & 0xF) + (wh & 0xF)+1 > h - j) {
|
||||
av_log(c->avctx, AV_LOG_ERROR, "Rectangle outside picture\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
paint_rect(dst2, xy >> 4, xy & 0xF, (wh>>4)+1, (wh & 0xF)+1, fg, bpp, stride);
|
||||
}
|
||||
}
|
||||
|
@@ -1503,6 +1503,7 @@ static int matroska_deliver_packet(MatroskaDemuxContext *matroska,
|
||||
*/
|
||||
static void matroska_clear_queue(MatroskaDemuxContext *matroska)
|
||||
{
|
||||
matroska->prev_pkt = NULL;
|
||||
if (matroska->packets) {
|
||||
int n;
|
||||
for (n = 0; n < matroska->num_packets; n++) {
|
||||
@@ -1820,10 +1821,11 @@ static int matroska_read_seek(AVFormatContext *s, int stream_index,
|
||||
if (tracks[i].type == MATROSKA_TRACK_TYPE_SUBTITLE
|
||||
&& !tracks[i].stream->discard != AVDISCARD_ALL) {
|
||||
index_sub = av_index_search_timestamp(tracks[i].stream, st->index_entries[index].timestamp, AVSEEK_FLAG_BACKWARD);
|
||||
if (index_sub >= 0
|
||||
&& st->index_entries[index_sub].pos < st->index_entries[index_min].pos
|
||||
&& st->index_entries[index].timestamp - st->index_entries[index_sub].timestamp < 30000000000/matroska->time_scale)
|
||||
index_min = index_sub;
|
||||
while(index_sub >= 0
|
||||
&& index_min >= 0
|
||||
&& tracks[i].stream->index_entries[index_sub].pos < st->index_entries[index_min].pos
|
||||
&& st->index_entries[index].timestamp - tracks[i].stream->index_entries[index_sub].timestamp < 30000000000/matroska->time_scale)
|
||||
index_min--;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -62,7 +62,13 @@ static inline int get_byte(LZOContext *c) {
|
||||
static inline int get_len(LZOContext *c, int x, int mask) {
|
||||
int cnt = x & mask;
|
||||
if (!cnt) {
|
||||
while (!(x = get_byte(c))) cnt += 255;
|
||||
while (!(x = get_byte(c))) {
|
||||
if (cnt >= INT_MAX - 1000) {
|
||||
c->error |= AV_LZO_ERROR;
|
||||
break;
|
||||
}
|
||||
cnt += 255;
|
||||
}
|
||||
cnt += mask + x;
|
||||
}
|
||||
return cnt;
|
||||
@@ -118,10 +124,10 @@ static inline void memcpy_backptr(uint8_t *dst, int back, int cnt);
|
||||
* cnt > back is valid, this will copy the bytes we just copied,
|
||||
* thus creating a repeating pattern with a period length of back.
|
||||
*/
|
||||
static inline void copy_backptr(LZOContext *c, int back, int cnt) {
|
||||
register const uint8_t *src = &c->out[-back];
|
||||
register uint8_t *dst = c->out;
|
||||
if (src < c->out_start || src > dst) {
|
||||
static inline void copy_backptr(LZOContext *c, int back, int cnt)
|
||||
{
|
||||
register uint8_t *dst = c->out;
|
||||
if (dst - c->out_start < back) {
|
||||
c->error |= AV_LZO_INVALID_BACKPTR;
|
||||
return;
|
||||
}
|
||||
|
Reference in New Issue
Block a user