avcodec/h264_slice: Check PPS more extensively when its not copied
Fixes Ticket5371 Fixes null pointer dereference Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
		
							parent
							
								
									8ff0f6ae82
								
							
						
					
					
						commit
						c50be7a52b
					
				@ -1282,10 +1282,14 @@ int ff_h264_decode_slice_header(H264Context *h, H264SliceContext *sl)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    if (first_slice) {
 | 
					    if (first_slice) {
 | 
				
			||||||
        h->pps = *h->pps_buffers[pps_id];
 | 
					        h->pps = *h->pps_buffers[pps_id];
 | 
				
			||||||
    } else if (h->setup_finished && h->dequant_coeff_pps != pps_id) {
 | 
					    } else {
 | 
				
			||||||
 | 
					        if (h->pps.sps_id != pps->sps_id ||
 | 
				
			||||||
 | 
					            h->pps.transform_8x8_mode != pps->transform_8x8_mode ||
 | 
				
			||||||
 | 
					            (h->setup_finished && h->dequant_coeff_pps != pps_id)) {
 | 
				
			||||||
            av_log(h->avctx, AV_LOG_ERROR, "PPS changed between slices\n");
 | 
					            av_log(h->avctx, AV_LOG_ERROR, "PPS changed between slices\n");
 | 
				
			||||||
            return AVERROR_INVALIDDATA;
 | 
					            return AVERROR_INVALIDDATA;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (pps->sps_id != h->sps.sps_id ||
 | 
					    if (pps->sps_id != h->sps.sps_id ||
 | 
				
			||||||
        pps->sps_id != h->current_sps_id ||
 | 
					        pps->sps_id != h->current_sps_id ||
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user