Showing the changes to libavfilter (1 of 1 file). Show all
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 | 233 | if (refcounted && !(flags & AV_BUFFERSRC_FLAG_KEEP_REF)) { |
| 234 | + if (!(copy = av_frame_alloc())) | |
| 235 | + return AVERROR(ENOMEM); | |
| 237 | 236 | av_frame_move_ref(copy, frame); |
| 238 | 237 | } else { |
| 239 | − ret = av_frame_ref(copy, frame); | |
| 240 | − if (ret < 0) { | |
| 241 | − av_frame_free(©); | |
| 242 | − return ret; | |
| 243 | − } | |
| 238 | + copy = av_frame_clone(frame); | |
| 239 | + if (!copy) | |
| 240 | + return AVERROR(ENOMEM); | |
| 244 | 241 | } |
| 245 | 242 | |
| 246 | 243 | #if FF_API_PKT_DURATION |