Fix crash when decoder returns 0 and when are using hwaccel
This commit is contained in:
parent
bf0ae8b270
commit
e562888ed0
|
@ -159,7 +159,7 @@ int ZMPacket::decode(AVCodecContext *ctx) {
|
|||
return 0;
|
||||
}
|
||||
int bytes_consumed = ret;
|
||||
if ( ret > 0 )
|
||||
if ( ret > 0 ) {
|
||||
zm_dump_video_frame(in_frame, "got frame");
|
||||
|
||||
#if HAVE_LIBAVUTIL_HWCONTEXT_H
|
||||
|
@ -237,7 +237,6 @@ int ZMPacket::decode(AVCodecContext *ctx) {
|
|||
} else
|
||||
#endif
|
||||
#endif
|
||||
if ( ret > 0 ) {
|
||||
Debug(2, "Same pix format %s so not hwtransferring. sw_pix_fmt is %s",
|
||||
av_get_pix_fmt_name(ctx->pix_fmt),
|
||||
av_get_pix_fmt_name(ctx->sw_pix_fmt)
|
||||
|
@ -247,7 +246,7 @@ int ZMPacket::decode(AVCodecContext *ctx) {
|
|||
image->Assign(in_frame);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
} // end if if ( ret > 0 ) {
|
||||
return bytes_consumed;
|
||||
} // end ZMPacket::decode
|
||||
|
||||
|
|
Loading…
Reference in New Issue