mpeg2: avoid crash when seeking with debug logs

Move down the debug message when the state of the decoder is verified
so the slice header is not NULL.
This commit is contained in:
Víctor Manuel Jáquez Leal 2015-05-27 10:49:56 +02:00
parent f1a60ec6a2
commit d6255be939

View file

@ -1141,8 +1141,6 @@ decode_slice(GstVaapiDecoderMpeg2 *decoder, GstVaapiDecoderUnit *unit)
GST_VAAPI_DECODER_CODEC_FRAME(decoder)->input_buffer;
GstMapInfo map_info;
GST_DEBUG("slice %d (%u bytes)", slice_hdr->mb_row, unit->size);
if (!is_valid_state(decoder, GST_MPEG_VIDEO_STATE_VALID_PIC_HEADERS))
return GST_VAAPI_DECODER_STATUS_SUCCESS;
@ -1151,6 +1149,8 @@ decode_slice(GstVaapiDecoderMpeg2 *decoder, GstVaapiDecoderUnit *unit)
return GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN;
}
GST_DEBUG("slice %d (%u bytes)", slice_hdr->mb_row, unit->size);
slice = GST_VAAPI_SLICE_NEW(MPEG2, decoder,
(map_info.data + unit->offset), unit->size);
gst_buffer_unmap(buffer, &map_info);