/* get a pointer to the codec context for the video stream */
input_codec_ctx = input_format_ctx->streams[video_index]->codec;
- if (input_codec_ctx == NULL) {
- fprintf(stderr, "input codec context is not valid\n");
- ret = -EINVAL;
- goto cleanup;
- }
/* find the decoder for the video stream */
input_codec = avcodec_find_decoder(input_codec_ctx->codec_id);
ret = avcodec_open2(input_codec_ctx, input_codec, NULL);
if (ret < 0) {
fprintf(stderr, "cannot open input codec\n");
- ret = -EINVAL;
goto cleanup;
}