Originally committed as revision 13472 to svn://svn.ffmpeg.org/ffmpeg/trunk
int64_t filesize= url_fsize(bc);
int64_t *syncpoints;
int8_t *has_keyframe;
int64_t filesize= url_fsize(bc);
int64_t *syncpoints;
int8_t *has_keyframe;
url_fseek(bc, filesize-12, SEEK_SET);
url_fseek(bc, filesize-get_be64(bc), SEEK_SET);
url_fseek(bc, filesize-12, SEEK_SET);
url_fseek(bc, filesize-get_be64(bc), SEEK_SET);
syncpoints= av_malloc(sizeof(int64_t)*syncpoint_count);
has_keyframe= av_malloc(sizeof(int8_t)*(syncpoint_count+1));
for(i=0; i<syncpoint_count; i++){
syncpoints= av_malloc(sizeof(int64_t)*syncpoint_count);
has_keyframe= av_malloc(sizeof(int8_t)*(syncpoint_count+1));
for(i=0; i<syncpoint_count; i++){
- GET_V(syncpoints[i], tmp>0)
+ syncpoints[i] = ff_get_v(bc);
+ if(syncpoints[i] <= 0)
+ goto fail;
if(i)
syncpoints[i] += syncpoints[i-1];
}
if(i)
syncpoints[i] += syncpoints[i-1];
}
x>>=1;
if(n+x >= syncpoint_count + 1){
av_log(s, AV_LOG_ERROR, "index overflow A\n");
x>>=1;
if(n+x >= syncpoint_count + 1){
av_log(s, AV_LOG_ERROR, "index overflow A\n");
}
while(x--)
has_keyframe[n++]= flag;
}
while(x--)
has_keyframe[n++]= flag;
while(x != 1){
if(n>=syncpoint_count + 1){
av_log(s, AV_LOG_ERROR, "index overflow B\n");
while(x != 1){
if(n>=syncpoint_count + 1){
av_log(s, AV_LOG_ERROR, "index overflow B\n");
}
has_keyframe[n++]= x&1;
x>>=1;
}
has_keyframe[n++]= x&1;
x>>=1;
}
if(has_keyframe[0]){
av_log(s, AV_LOG_ERROR, "keyframe before first syncpoint in index\n");
}
if(has_keyframe[0]){
av_log(s, AV_LOG_ERROR, "keyframe before first syncpoint in index\n");
}
assert(n<=syncpoint_count+1);
for(; j<n && j<syncpoint_count; j++){
}
assert(n<=syncpoint_count+1);
for(; j<n && j<syncpoint_count; j++){
if(skip_reserved(bc, end) || get_checksum(bc)){
av_log(s, AV_LOG_ERROR, "index checksum mismatch\n");
if(skip_reserved(bc, end) || get_checksum(bc)){
av_log(s, AV_LOG_ERROR, "index checksum mismatch\n");
+ ret= 0;
+fail:
+ av_free(syncpoints);
+ av_free(has_keyframe);
+ return ret;
}
static int nut_read_header(AVFormatContext *s, AVFormatParameters *ap)
}
static int nut_read_header(AVFormatContext *s, AVFormatParameters *ap)