check nativeWindow is null or not

check nativeWindow is null or not
pull/166/head
xufulong 4 years ago
parent 29adee4aae
commit 661401f4a5
  1. 4
      app/src/main/cpp/video_filter.c

@ -187,6 +187,10 @@ int open_input(JNIEnv *env, const char *file_name, jobject surface) {
} }
nativeWindow = ANativeWindow_fromSurface(env, surface); nativeWindow = ANativeWindow_fromSurface(env, surface);
if (!nativeWindow) {
LOGE(TAG, "nativeWindow is null...");
return -1;
}
ANativeWindow_setBuffersGeometry(nativeWindow, pCodecCtx->width, pCodecCtx->height, ANativeWindow_setBuffersGeometry(nativeWindow, pCodecCtx->width, pCodecCtx->height,
WINDOW_FORMAT_RGBA_8888); WINDOW_FORMAT_RGBA_8888);
pFrame = av_frame_alloc(); pFrame = av_frame_alloc();

Loading…
Cancel
Save