rv34: check that subsequent slices have the same type as first one.
This prevents some crashes when corrupted bitstream reports e.g. P-type
slice in I-frame. Official RealVideo decoder demands all slices to be
of the same type too.
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 23a1f0c592)
			
			
This commit is contained in:
		
				
					committed by
					
						
						Michael Niedermayer
					
				
			
			
				
	
			
			
			
						parent
						
							eb6b0ed8be
						
					
				
				
					commit
					d8439f0452
				
			@@ -1269,6 +1269,13 @@ static int rv34_decode_slice(RV34DecContext *r, int end, const uint8_t* buf, int
 | 
			
		||||
            r->next_pts = r->cur_pts;
 | 
			
		||||
        }
 | 
			
		||||
        s->mb_x = s->mb_y = 0;
 | 
			
		||||
    } else {
 | 
			
		||||
        int slice_type = r->si.type ? r->si.type : FF_I_TYPE;
 | 
			
		||||
 | 
			
		||||
        if (slice_type != s->pict_type) {
 | 
			
		||||
            av_log(s->avctx, AV_LOG_ERROR, "Slice type mismatch\n");
 | 
			
		||||
            return AVERROR_INVALIDDATA;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    r->si.end = end;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user