mov: Fix detecting there is no sync sample.
Stss atom without entries doesn't mean every sample is a sync sample. Signed-off-by: Martin Storsjö <martin@martin.st>
This commit is contained in:
		
							parent
							
								
									f346b6bbeb
								
							
						
					
					
						commit
						accea4d9d8
					
				| @ -106,6 +106,7 @@ typedef struct MOVStreamContext { | |||||||
|     unsigned int sample_size; |     unsigned int sample_size; | ||||||
|     unsigned int sample_count; |     unsigned int sample_count; | ||||||
|     int *sample_sizes; |     int *sample_sizes; | ||||||
|  |     int keyframe_absent; | ||||||
|     unsigned int keyframe_count; |     unsigned int keyframe_count; | ||||||
|     int *keyframes; |     int *keyframes; | ||||||
|     int time_scale; |     int time_scale; | ||||||
|  | |||||||
| @ -1534,7 +1534,10 @@ static int mov_read_stss(MOVContext *c, AVIOContext *pb, MOVAtom atom) | |||||||
|     av_dlog(c->fc, "keyframe_count = %d\n", entries); |     av_dlog(c->fc, "keyframe_count = %d\n", entries); | ||||||
| 
 | 
 | ||||||
|     if (!entries) |     if (!entries) | ||||||
|  |     { | ||||||
|  |         sc->keyframe_absent = 1; | ||||||
|         return 0; |         return 0; | ||||||
|  |     } | ||||||
|     if (entries >= UINT_MAX / sizeof(int)) |     if (entries >= UINT_MAX / sizeof(int)) | ||||||
|         return AVERROR_INVALIDDATA; |         return AVERROR_INVALIDDATA; | ||||||
|     sc->keyframes = av_malloc(entries * sizeof(int)); |     sc->keyframes = av_malloc(entries * sizeof(int)); | ||||||
| @ -1776,7 +1779,7 @@ static void mov_build_index(MOVContext *mov, AVStream *st) | |||||||
|                     return; |                     return; | ||||||
|                 } |                 } | ||||||
| 
 | 
 | ||||||
|                 if (!sc->keyframe_count || current_sample+key_off == sc->keyframes[stss_index]) { |                 if (!sc->keyframe_absent && (!sc->keyframe_count || current_sample+key_off == sc->keyframes[stss_index])) { | ||||||
|                     keyframe = 1; |                     keyframe = 1; | ||||||
|                     if (stss_index + 1 < sc->keyframe_count) |                     if (stss_index + 1 < sc->keyframe_count) | ||||||
|                         stss_index++; |                         stss_index++; | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user