| 893 | } |
| 894 | |
| 895 | int av_opt_set_bin(void *obj, const char *name, const uint8_t *val, int len, int search_flags) |
| 896 | { |
| 897 | uint8_t *ptr; |
| 898 | uint8_t **dst; |
| 899 | int *lendst; |
| 900 | int ret; |
| 901 | |
| 902 | ret = opt_set_init(obj, name, search_flags, AV_OPT_TYPE_BINARY, |
| 903 | NULL, NULL, (void**)&dst); |
| 904 | if (ret < 0) |
| 905 | return ret; |
| 906 | |
| 907 | ptr = len ? av_malloc(len) : NULL; |
| 908 | if (len && !ptr) |
| 909 | return AVERROR(ENOMEM); |
| 910 | |
| 911 | lendst = (int *)(dst + 1); |
| 912 | |
| 913 | av_free(*dst); |
| 914 | *dst = ptr; |
| 915 | *lendst = len; |
| 916 | if (len) |
| 917 | memcpy(ptr, val, len); |
| 918 | |
| 919 | return 0; |
| 920 | } |
| 921 | |
| 922 | int av_opt_set_image_size(void *obj, const char *name, int w, int h, int search_flags) |
| 923 | { |
no test coverage detected