Unified · Split
| @@ -230,17 +230,14 @@ FF_ENABLE_DEPRECATION_WARNINGS · 229 unmodified lines | |||
| 230 | 230 | ||
| 231 | } | 231 | } |
| 232 | 232 | ||
| 233 | if (!(copy = av_frame_alloc())) | ||
| 234 | return AVERROR(ENOMEM); | ||
| 235 | |||
| 236 | if (refcounted && !(flags & AV_BUFFERSRC_FLAG_KEEP_REF)) { | 233 | if (refcounted && !(flags & AV_BUFFERSRC_FLAG_KEEP_REF)) { |
| 234 | if (!(copy = av_frame_alloc())) | ||
| 235 | return AVERROR(ENOMEM); | ||
| 237 | av_frame_move_ref(copy, frame); | 236 | av_frame_move_ref(copy, frame); |
| 238 | } else { | 237 | } else { |
| 239 | ret = av_frame_ref(copy, frame); | 238 | copy = av_frame_clone(frame); |
| 240 | if (ret < 0) { | 239 | if (!copy) |
| 241 | av_frame_free(©); | 240 | return AVERROR(ENOMEM); |
| 242 | return ret; | ||
| 243 | } | ||
| 244 | } | 241 | } |
| 245 | 242 | ||
| 246 | #if FF_API_PKT_DURATION | 243 | #if FF_API_PKT_DURATION |